hls.js 1.6.0-beta.2.0.canary.10880 → 1.6.0-beta.2.0.canary.10883

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hls.js CHANGED
@@ -20,12 +20,12 @@
20
20
  function _defineProperties(e, r) {
21
21
  for (var t = 0; t < r.length; t++) {
22
22
  var o = r[t];
23
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
23
+ o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
24
24
  }
25
25
  }
26
26
  function _createClass(e, r, t) {
27
27
  return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
28
- writable: !1
28
+ writable: false
29
29
  }), e;
30
30
  }
31
31
  function _createForOfIteratorHelperLoose(r, e) {
@@ -36,9 +36,9 @@
36
36
  var o = 0;
37
37
  return function () {
38
38
  return o >= r.length ? {
39
- done: !0
39
+ done: true
40
40
  } : {
41
- done: !1,
41
+ done: false,
42
42
  value: r[o++]
43
43
  };
44
44
  };
@@ -48,9 +48,9 @@
48
48
  function _defineProperty(e, r, t) {
49
49
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
50
50
  value: t,
51
- enumerable: !0,
52
- configurable: !0,
53
- writable: !0
51
+ enumerable: true,
52
+ configurable: true,
53
+ writable: true
54
54
  }) : e[r] = t, e;
55
55
  }
56
56
  function _extends() {
@@ -98,7 +98,7 @@
98
98
  function _objectSpread2(e) {
99
99
  for (var r = 1; r < arguments.length; r++) {
100
100
  var t = null != arguments[r] ? arguments[r] : {};
101
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
101
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
102
102
  _defineProperty(e, r, t[r]);
103
103
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
104
104
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
@@ -114,7 +114,7 @@
114
114
  function _toPrimitive(t, r) {
115
115
  if ("object" != typeof t || !t) return t;
116
116
  var e = t[Symbol.toPrimitive];
117
- if (void 0 !== e) {
117
+ if (undefined !== e) {
118
118
  var i = e.call(t, r || "default");
119
119
  if ("object" != typeof i) return i;
120
120
  throw new TypeError("@@toPrimitive must return a primitive value.");
@@ -129,15 +129,15 @@
129
129
  if (r) {
130
130
  if ("string" == typeof r) return _arrayLikeToArray(r, a);
131
131
  var t = {}.toString.call(r).slice(8, -1);
132
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
132
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : undefined;
133
133
  }
134
134
  }
135
135
  function _wrapNativeSuper(t) {
136
- var r = "function" == typeof Map ? new Map() : void 0;
136
+ var r = "function" == typeof Map ? new Map() : undefined;
137
137
  return _wrapNativeSuper = function (t) {
138
138
  if (null === t || !_isNativeFunction(t)) return t;
139
139
  if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
140
- if (void 0 !== r) {
140
+ if (undefined !== r) {
141
141
  if (r.has(t)) return r.get(t);
142
142
  r.set(t, Wrapper);
143
143
  }
@@ -147,9 +147,9 @@
147
147
  return Wrapper.prototype = Object.create(t.prototype, {
148
148
  constructor: {
149
149
  value: Wrapper,
150
- enumerable: !1,
151
- writable: !0,
152
- configurable: !0
150
+ enumerable: false,
151
+ writable: true,
152
+ configurable: true
153
153
  }
154
154
  }), _setPrototypeOf(Wrapper, t);
155
155
  }, _wrapNativeSuper(t);
@@ -785,6 +785,7 @@
785
785
  Events["MEDIA_DETACHING"] = "hlsMediaDetaching";
786
786
  Events["MEDIA_DETACHED"] = "hlsMediaDetached";
787
787
  Events["MEDIA_ENDED"] = "hlsMediaEnded";
788
+ Events["STALL_RESOLVED"] = "hlsStallResolved";
788
789
  Events["BUFFER_RESET"] = "hlsBufferReset";
789
790
  Events["BUFFER_CODECS"] = "hlsBufferCodecs";
790
791
  Events["BUFFER_CREATED"] = "hlsBufferCreated";
@@ -880,16 +881,16 @@
880
881
  var EWMA = /*#__PURE__*/function () {
881
882
  // About half of the estimated value will be from the last |halfLife| samples by weight.
882
883
  function EWMA(halfLife, estimate, weight) {
883
- if (estimate === void 0) {
884
+ if (estimate === undefined) {
884
885
  estimate = 0;
885
886
  }
886
- if (weight === void 0) {
887
+ if (weight === undefined) {
887
888
  weight = 0;
888
889
  }
889
- this.halfLife = void 0;
890
- this.alpha_ = void 0;
891
- this.estimate_ = void 0;
892
- this.totalWeight_ = void 0;
890
+ this.halfLife = undefined;
891
+ this.alpha_ = undefined;
892
+ this.estimate_ = undefined;
893
+ this.totalWeight_ = undefined;
893
894
  this.halfLife = halfLife;
894
895
  // Larger values of alpha expire historical data more slowly.
895
896
  this.alpha_ = halfLife ? Math.exp(Math.log(0.5) / halfLife) : 0;
@@ -919,16 +920,16 @@
919
920
 
920
921
  var EwmaBandWidthEstimator = /*#__PURE__*/function () {
921
922
  function EwmaBandWidthEstimator(slow, fast, defaultEstimate, defaultTTFB) {
922
- if (defaultTTFB === void 0) {
923
+ if (defaultTTFB === undefined) {
923
924
  defaultTTFB = 100;
924
925
  }
925
- this.defaultEstimate_ = void 0;
926
- this.minWeight_ = void 0;
927
- this.minDelayMs_ = void 0;
928
- this.slow_ = void 0;
929
- this.fast_ = void 0;
930
- this.defaultTTFB_ = void 0;
931
- this.ttfb_ = void 0;
926
+ this.defaultEstimate_ = undefined;
927
+ this.minWeight_ = undefined;
928
+ this.minDelayMs_ = undefined;
929
+ this.slow_ = undefined;
930
+ this.fast_ = undefined;
931
+ this.defaultTTFB_ = undefined;
932
+ this.ttfb_ = undefined;
932
933
  this.defaultEstimate_ = defaultEstimate;
933
934
  this.minWeight_ = 0.001;
934
935
  this.minDelayMs_ = 50;
@@ -1000,12 +1001,12 @@
1000
1001
  }();
1001
1002
 
1002
1003
  var Logger = function Logger(label, logger) {
1003
- this.trace = void 0;
1004
- this.debug = void 0;
1005
- this.log = void 0;
1006
- this.warn = void 0;
1007
- this.info = void 0;
1008
- this.error = void 0;
1004
+ this.trace = undefined;
1005
+ this.debug = undefined;
1006
+ this.log = undefined;
1007
+ this.warn = undefined;
1008
+ this.info = undefined;
1009
+ this.error = undefined;
1009
1010
  var lb = "[" + label + "]:";
1010
1011
  this.trace = noop;
1011
1012
  this.debug = logger.debug.bind(null, lb);
@@ -1058,7 +1059,7 @@
1058
1059
  // Some browsers don't allow to use bind on console object anyway
1059
1060
  // fallback to default if needed
1060
1061
  try {
1061
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.2.0.canary.10880");
1062
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.2.0.canary.10883");
1062
1063
  } catch (e) {
1063
1064
  /* log fn threw an exception. All logger methods are no-ops. */
1064
1065
  return createLogger();
@@ -1076,7 +1077,7 @@
1076
1077
  var logger = exportedLogger;
1077
1078
 
1078
1079
  function getMediaSource(preferManagedMediaSource) {
1079
- if (preferManagedMediaSource === void 0) {
1080
+ if (preferManagedMediaSource === undefined) {
1080
1081
  preferManagedMediaSource = true;
1081
1082
  }
1082
1083
  if (typeof self === 'undefined') return undefined;
@@ -1181,7 +1182,7 @@
1181
1182
  return !!typeCodes && !!typeCodes[codec.slice(0, 4)];
1182
1183
  }
1183
1184
  function areCodecsMediaSourceSupported(codecs, type, preferManagedMediaSource) {
1184
- if (preferManagedMediaSource === void 0) {
1185
+ if (preferManagedMediaSource === undefined) {
1185
1186
  preferManagedMediaSource = true;
1186
1187
  }
1187
1188
  return !codecs.split(',').some(function (codec) {
@@ -1190,11 +1191,11 @@
1190
1191
  }
1191
1192
  function isCodecMediaSourceSupported(codec, type, preferManagedMediaSource) {
1192
1193
  var _MediaSource$isTypeSu;
1193
- if (preferManagedMediaSource === void 0) {
1194
+ if (preferManagedMediaSource === undefined) {
1194
1195
  preferManagedMediaSource = true;
1195
1196
  }
1196
1197
  var MediaSource = getMediaSource(preferManagedMediaSource);
1197
- return (_MediaSource$isTypeSu = MediaSource == null ? void 0 : MediaSource.isTypeSupported(mimeTypeForCodec(codec, type))) != null ? _MediaSource$isTypeSu : false;
1198
+ return (_MediaSource$isTypeSu = MediaSource == null ? undefined : MediaSource.isTypeSupported(mimeTypeForCodec(codec, type))) != null ? _MediaSource$isTypeSu : false;
1198
1199
  }
1199
1200
  function mimeTypeForCodec(codec, type) {
1200
1201
  return type + "/mp4;codecs=" + codec;
@@ -1217,7 +1218,7 @@
1217
1218
  }
1218
1219
  var CODEC_COMPATIBLE_NAMES = {};
1219
1220
  function getCodecCompatibleNameLower(lowerCaseCodec, preferManagedMediaSource) {
1220
- if (preferManagedMediaSource === void 0) {
1221
+ if (preferManagedMediaSource === undefined) {
1221
1222
  preferManagedMediaSource = true;
1222
1223
  }
1223
1224
  if (CODEC_COMPATIBLE_NAMES[lowerCaseCodec]) {
@@ -1246,7 +1247,7 @@
1246
1247
  }
1247
1248
  var AUDIO_CODEC_REGEXP = /flac|opus|mp4a\.40\.34/i;
1248
1249
  function getCodecCompatibleName(codec, preferManagedMediaSource) {
1249
- if (preferManagedMediaSource === void 0) {
1250
+ if (preferManagedMediaSource === undefined) {
1250
1251
  preferManagedMediaSource = true;
1251
1252
  }
1252
1253
  return codec.replace(AUDIO_CODEC_REGEXP, function (m) {
@@ -1327,8 +1328,8 @@
1327
1328
  function requiresMediaCapabilitiesDecodingInfo(level, audioTracksByGroup, currentVideoRange, currentFrameRate, currentBw, audioPreference) {
1328
1329
  // Only test support when configuration is exceeds minimum options
1329
1330
  var audioGroups = level.audioCodec ? level.audioGroups : null;
1330
- var audioCodecPreference = audioPreference == null ? void 0 : audioPreference.audioCodec;
1331
- var channelsPreference = audioPreference == null ? void 0 : audioPreference.channels;
1331
+ var audioCodecPreference = audioPreference == null ? undefined : audioPreference.audioCodec;
1332
+ var channelsPreference = audioPreference == null ? undefined : audioPreference.channels;
1332
1333
  var maxChannels = channelsPreference ? parseInt(channelsPreference) : audioCodecPreference ? Infinity : 2;
1333
1334
  var audioChannels = null;
1334
1335
  if (audioGroups != null && audioGroups.length) {
@@ -1394,7 +1395,7 @@
1394
1395
  if (!audioGroupId) {
1395
1396
  return;
1396
1397
  }
1397
- (_audioTracksByGroup$g = audioTracksByGroup.groups[audioGroupId]) == null ? void 0 : _audioTracksByGroup$g.tracks.forEach(function (audioTrack) {
1398
+ (_audioTracksByGroup$g = audioTracksByGroup.groups[audioGroupId]) == null ? undefined : _audioTracksByGroup$g.tracks.forEach(function (audioTrack) {
1398
1399
  if (audioTrack.groupId === audioGroupId) {
1399
1400
  var channels = audioTrack.channels || '';
1400
1401
  var channelsNumber = parseFloat(channels);
@@ -1483,9 +1484,9 @@
1483
1484
  }
1484
1485
  var HlsUrlParameters = /*#__PURE__*/function () {
1485
1486
  function HlsUrlParameters(msn, part, skip) {
1486
- this.msn = void 0;
1487
- this.part = void 0;
1488
- this.skip = void 0;
1487
+ this.msn = undefined;
1488
+ this.part = undefined;
1489
+ this.skip = undefined;
1489
1490
  this.msn = msn;
1490
1491
  this.part = part;
1491
1492
  this.skip = skip;
@@ -1508,27 +1509,27 @@
1508
1509
  }();
1509
1510
  var Level = /*#__PURE__*/function () {
1510
1511
  function Level(data) {
1511
- this._attrs = void 0;
1512
- this.audioCodec = void 0;
1513
- this.bitrate = void 0;
1514
- this.codecSet = void 0;
1515
- this.url = void 0;
1516
- this.frameRate = void 0;
1517
- this.height = void 0;
1518
- this.id = void 0;
1519
- this.name = void 0;
1520
- this.videoCodec = void 0;
1521
- this.width = void 0;
1522
- this.details = void 0;
1512
+ this._attrs = undefined;
1513
+ this.audioCodec = undefined;
1514
+ this.bitrate = undefined;
1515
+ this.codecSet = undefined;
1516
+ this.url = undefined;
1517
+ this.frameRate = undefined;
1518
+ this.height = undefined;
1519
+ this.id = undefined;
1520
+ this.name = undefined;
1521
+ this.videoCodec = undefined;
1522
+ this.width = undefined;
1523
+ this.details = undefined;
1523
1524
  this.fragmentError = 0;
1524
1525
  this.loadError = 0;
1525
- this.loaded = void 0;
1526
+ this.loaded = undefined;
1526
1527
  this.realBitrate = 0;
1527
- this.supportedPromise = void 0;
1528
- this.supportedResult = void 0;
1528
+ this.supportedPromise = undefined;
1529
+ this.supportedResult = undefined;
1529
1530
  this._avgBitrate = 0;
1530
- this._audioGroups = void 0;
1531
- this._subtitleGroups = void 0;
1531
+ this._audioGroups = undefined;
1532
+ this._subtitleGroups = undefined;
1532
1533
  // Deprecated (retained for backwards compatibility)
1533
1534
  this._urlId = 0;
1534
1535
  this.url = [data.url];
@@ -1656,13 +1657,13 @@
1656
1657
  key: "audioGroupId",
1657
1658
  get: function get() {
1658
1659
  var _this$audioGroups;
1659
- return (_this$audioGroups = this.audioGroups) == null ? void 0 : _this$audioGroups[0];
1660
+ return (_this$audioGroups = this.audioGroups) == null ? undefined : _this$audioGroups[0];
1660
1661
  }
1661
1662
  }, {
1662
1663
  key: "textGroupId",
1663
1664
  get: function get() {
1664
1665
  var _this$subtitleGroups;
1665
- return (_this$subtitleGroups = this.subtitleGroups) == null ? void 0 : _this$subtitleGroups[0];
1666
+ return (_this$subtitleGroups = this.subtitleGroups) == null ? undefined : _this$subtitleGroups[0];
1666
1667
  }
1667
1668
  }]);
1668
1669
  }();
@@ -1729,9 +1730,9 @@
1729
1730
 
1730
1731
  function getStartCodecTier(codecTiers, currentVideoRange, currentBw, audioPreference, videoPreference) {
1731
1732
  var codecSets = Object.keys(codecTiers);
1732
- var channelsPreference = audioPreference == null ? void 0 : audioPreference.channels;
1733
- var audioCodecPreference = audioPreference == null ? void 0 : audioPreference.audioCodec;
1734
- var videoCodecPreference = videoPreference == null ? void 0 : videoPreference.videoCodec;
1733
+ var channelsPreference = audioPreference == null ? undefined : audioPreference.channels;
1734
+ var audioCodecPreference = audioPreference == null ? undefined : audioPreference.audioCodec;
1735
+ var videoCodecPreference = videoPreference == null ? undefined : videoPreference.videoCodec;
1735
1736
  var preferStereo = channelsPreference && parseInt(channelsPreference) === 2;
1736
1737
  // Use first level set to determine stereo, and minimum resolution and framerate
1737
1738
  var hasStereo = false;
@@ -1972,7 +1973,7 @@
1972
1973
  return (groupId === undefined || track.groupId === groupId) && (name === undefined || track.name === name) && (lang === undefined || languagesMatch(lang, track.lang)) && (lang === undefined || track.assocLang === assocLang) && (isDefault === undefined || track.default === isDefault) && (forced === undefined || track.forced === forced) && (characteristics === undefined || characteristicsMatch(characteristics, track.characteristics)) && (matchPredicate === undefined || matchPredicate(option, track));
1973
1974
  }
1974
1975
  function languagesMatch(languageA, languageB) {
1975
- if (languageB === void 0) {
1976
+ if (languageB === undefined) {
1976
1977
  languageB = '--';
1977
1978
  }
1978
1979
  if (languageA.length === languageB.length) {
@@ -1981,7 +1982,7 @@
1981
1982
  return languageA.startsWith(languageB) || languageB.startsWith(languageA);
1982
1983
  }
1983
1984
  function characteristicsMatch(characteristicsA, characteristicsB) {
1984
- if (characteristicsB === void 0) {
1985
+ if (characteristicsB === undefined) {
1985
1986
  characteristicsB = '';
1986
1987
  }
1987
1988
  var arrA = characteristicsA.split(',');
@@ -2050,14 +2051,14 @@
2050
2051
  }
2051
2052
  function useAlternateAudio(audioTrackUrl, hls) {
2052
2053
  var _hls$levels$hls$loadL;
2053
- return !!audioTrackUrl && audioTrackUrl !== ((_hls$levels$hls$loadL = hls.levels[hls.loadLevel]) == null ? void 0 : _hls$levels$hls$loadL.uri);
2054
+ return !!audioTrackUrl && audioTrackUrl !== ((_hls$levels$hls$loadL = hls.levels[hls.loadLevel]) == null ? undefined : _hls$levels$hls$loadL.uri);
2054
2055
  }
2055
2056
 
2056
2057
  var AbrController = /*#__PURE__*/function (_Logger) {
2057
2058
  function AbrController(_hls) {
2058
2059
  var _this;
2059
2060
  _this = _Logger.call(this, 'abr', _hls.logger) || this;
2060
- _this.hls = void 0;
2061
+ _this.hls = undefined;
2061
2062
  _this.lastLevelLoadSec = 0;
2062
2063
  _this.lastLoadedFragLevel = -1;
2063
2064
  _this.firstSelection = -1;
@@ -2069,7 +2070,7 @@
2069
2070
  _this.fragCurrent = null;
2070
2071
  _this.partCurrent = null;
2071
2072
  _this.bitrateTestDelay = 0;
2072
- _this.bwEstimator = void 0;
2073
+ _this.bwEstimator = undefined;
2073
2074
  /*
2074
2075
  This method monitors the download rate of the current fragment, and will downswitch if that fragment will not load
2075
2076
  quickly enough to prevent underbuffering
@@ -2134,7 +2135,7 @@
2134
2135
  return;
2135
2136
  }
2136
2137
  var bwe = loadRate ? loadRate * 8 : bwEstimate;
2137
- var live = ((_this$hls$latestLevel = _this.hls.latestLevelDetails) == null ? void 0 : _this$hls$latestLevel.live) === true;
2138
+ var live = ((_this$hls$latestLevel = _this.hls.latestLevelDetails) == null ? undefined : _this$hls$latestLevel.live) === true;
2138
2139
  var abrBandWidthUpFactor = _this.hls.config.abrBandWidthUpFactor;
2139
2140
  var fragLevelNextLoadedDelay = Number.POSITIVE_INFINITY;
2140
2141
  var nextLoadLevel;
@@ -2471,7 +2472,7 @@
2471
2472
  // If no matching level found, see if min auto level would be a better option
2472
2473
  var minLevel = hls.levels[minAutoLevel];
2473
2474
  var autoLevel = hls.levels[hls.loadLevel];
2474
- if ((minLevel == null ? void 0 : minLevel.bitrate) < (autoLevel == null ? void 0 : autoLevel.bitrate)) {
2475
+ if ((minLevel == null ? undefined : minLevel.bitrate) < (autoLevel == null ? undefined : autoLevel.bitrate)) {
2475
2476
  return minAutoLevel;
2476
2477
  }
2477
2478
  // or if bitrate is not lower, continue to use loadLevel
@@ -2513,7 +2514,7 @@
2513
2514
  var firstSelection = loadLevel === -1 || lastLoadedFragLevel === -1;
2514
2515
  var currentCodecSet;
2515
2516
  var currentVideoRange = 'SDR';
2516
- var currentFrameRate = (level == null ? void 0 : level.frameRate) || 0;
2517
+ var currentFrameRate = (level == null ? undefined : level.frameRate) || 0;
2517
2518
  var audioPreference = config.audioPreference,
2518
2519
  videoPreference = config.videoPreference;
2519
2520
  var audioTracksByGroup = this.audioTracksByGroup || (this.audioTracksByGroup = getAudioTracksByGroup(allAudioTracks));
@@ -2537,8 +2538,8 @@
2537
2538
  currentBw = Math.max(currentBw, minBitrate);
2538
2539
  this.log("picked start tier " + JSON.stringify(startTier));
2539
2540
  } else {
2540
- currentCodecSet = level == null ? void 0 : level.codecSet;
2541
- currentVideoRange = level == null ? void 0 : level.videoRange;
2541
+ currentCodecSet = level == null ? undefined : level.codecSet;
2542
+ currentVideoRange = level == null ? undefined : level.videoRange;
2542
2543
  }
2543
2544
  var currentFragDuration = partCurrent ? partCurrent.duration : fragCurrent ? fragCurrent.duration : 0;
2544
2545
  var ttfbEstimateSec = this.bwEstimator.getEstimateTTFB() / 1000;
@@ -2553,7 +2554,7 @@
2553
2554
  if (config.useMediaCapabilities && !levelInfo.supportedResult && !levelInfo.supportedPromise) {
2554
2555
  var _levelInfo$videoCodec;
2555
2556
  var mediaCapabilities = navigator.mediaCapabilities;
2556
- if (typeof (mediaCapabilities == null ? void 0 : mediaCapabilities.decodingInfo) === 'function' && (requiresMediaCapabilitiesDecodingInfo(levelInfo, audioTracksByGroup, currentVideoRange, currentFrameRate, currentBw, audioPreference) || ((_levelInfo$videoCodec = levelInfo.videoCodec) == null ? void 0 : _levelInfo$videoCodec.substring(0, 4)) === 'hvc1') // Force media capabilities check for HEVC to avoid failure on Windows
2557
+ if (typeof (mediaCapabilities == null ? undefined : mediaCapabilities.decodingInfo) === 'function' && (requiresMediaCapabilitiesDecodingInfo(levelInfo, audioTracksByGroup, currentVideoRange, currentFrameRate, currentBw, audioPreference) || ((_levelInfo$videoCodec = levelInfo.videoCodec) == null ? undefined : _levelInfo$videoCodec.substring(0, 4)) === 'hvc1') // Force media capabilities check for HEVC to avoid failure on Windows
2557
2558
  ) {
2558
2559
  levelInfo.supportedPromise = getMediaDecodingInfoPromise(levelInfo, audioTracksByGroup, mediaCapabilities);
2559
2560
  levelInfo.supportedPromise.then(function (decodingInfo) {
@@ -2590,7 +2591,7 @@
2590
2591
  }
2591
2592
  }
2592
2593
  var levelDetails = levelInfo.details;
2593
- var avgDuration = (partCurrent ? levelDetails == null ? void 0 : levelDetails.partTarget : levelDetails == null ? void 0 : levelDetails.averagetargetduration) || currentFragDuration;
2594
+ var avgDuration = (partCurrent ? levelDetails == null ? undefined : levelDetails.partTarget : levelDetails == null ? undefined : levelDetails.averagetargetduration) || currentFragDuration;
2594
2595
  var adjustedbw;
2595
2596
  // follow algorithm captured from stagefright :
2596
2597
  // https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp
@@ -2788,13 +2789,13 @@
2788
2789
  * @returns a matching fragment or null
2789
2790
  */
2790
2791
  function findFragmentByPTS(fragPrevious, fragments, bufferEnd, maxFragLookUpTolerance, nextFragLookupTolerance) {
2791
- if (bufferEnd === void 0) {
2792
+ if (bufferEnd === undefined) {
2792
2793
  bufferEnd = 0;
2793
2794
  }
2794
- if (maxFragLookUpTolerance === void 0) {
2795
+ if (maxFragLookUpTolerance === undefined) {
2795
2796
  maxFragLookUpTolerance = 0;
2796
2797
  }
2797
- if (nextFragLookupTolerance === void 0) {
2798
+ if (nextFragLookupTolerance === undefined) {
2798
2799
  nextFragLookupTolerance = 0.005;
2799
2800
  }
2800
2801
  var fragNext = null;
@@ -2844,10 +2845,10 @@
2844
2845
  * @returns 0 if it matches, 1 if too low, -1 if too high
2845
2846
  */
2846
2847
  function fragmentWithinToleranceTest(bufferEnd, maxFragLookUpTolerance, candidate) {
2847
- if (bufferEnd === void 0) {
2848
+ if (bufferEnd === undefined) {
2848
2849
  bufferEnd = 0;
2849
2850
  }
2850
- if (maxFragLookUpTolerance === void 0) {
2851
+ if (maxFragLookUpTolerance === undefined) {
2851
2852
  maxFragLookUpTolerance = 0;
2852
2853
  }
2853
2854
  // eagerly accept an accurate match (no tolerance)
@@ -2959,7 +2960,7 @@
2959
2960
  if (!retryConfig) {
2960
2961
  return false;
2961
2962
  }
2962
- var httpStatus = loaderResponse == null ? void 0 : loaderResponse.code;
2963
+ var httpStatus = loaderResponse == null ? undefined : loaderResponse.code;
2963
2964
  var retry = retryCount < retryConfig.maxNumRetry && (retryForHttpStatus(httpStatus) || !!isTimeout);
2964
2965
  return retryConfig.shouldRetry ? retryConfig.shouldRetry(retryConfig, retryCount, isTimeout, loaderResponse, retry) : retry;
2965
2966
  }
@@ -2986,7 +2987,7 @@
2986
2987
  function ErrorController(hls) {
2987
2988
  var _this;
2988
2989
  _this = _Logger.call(this, 'error-controller', hls.logger) || this;
2989
- _this.hls = void 0;
2990
+ _this.hls = undefined;
2990
2991
  _this.playlistError = 0;
2991
2992
  _this.penalizedRenditions = {};
2992
2993
  _this.hls = hls;
@@ -3022,7 +3023,7 @@
3022
3023
  this.playlistError = 0;
3023
3024
  };
3024
3025
  _proto.getVariantLevelIndex = function getVariantLevelIndex(frag) {
3025
- return (frag == null ? void 0 : frag.type) === PlaylistLevelType.MAIN ? frag.level : this.hls.loadLevel;
3026
+ return (frag == null ? undefined : frag.type) === PlaylistLevelType.MAIN ? frag.level : this.hls.loadLevel;
3026
3027
  };
3027
3028
  _proto.onManifestLoading = function onManifestLoading() {
3028
3029
  this.playlistError = 0;
@@ -3077,7 +3078,7 @@
3077
3078
  return;
3078
3079
  case ErrorDetails.LEVEL_LOAD_ERROR:
3079
3080
  case ErrorDetails.LEVEL_LOAD_TIMEOUT:
3080
- if (typeof (context == null ? void 0 : context.level) === 'number') {
3081
+ if (typeof (context == null ? undefined : context.level) === 'number') {
3081
3082
  data.errorAction = this.getPlaylistRetryOrSwitchAction(data, context.level);
3082
3083
  }
3083
3084
  return;
@@ -3100,7 +3101,7 @@
3100
3101
  case ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:
3101
3102
  {
3102
3103
  var _level = hls.levels[hls.loadLevel];
3103
- var restrictedHdcpLevel = _level == null ? void 0 : _level.attrs['HDCP-LEVEL'];
3104
+ var restrictedHdcpLevel = _level == null ? undefined : _level.attrs['HDCP-LEVEL'];
3104
3105
  if (restrictedHdcpLevel) {
3105
3106
  data.errorAction = {
3106
3107
  action: NetworkErrorAction.SendAlternateToPenaltyBox,
@@ -3221,7 +3222,7 @@
3221
3222
  if (!hls.autoLevelEnabled) {
3222
3223
  hls.loadLevel = -1;
3223
3224
  }
3224
- var fragErrorType = (_data$frag2 = data.frag) == null ? void 0 : _data$frag2.type;
3225
+ var fragErrorType = (_data$frag2 = data.frag) == null ? undefined : _data$frag2.type;
3225
3226
  // Find alternate audio codec if available on audio codec error
3226
3227
  var isAudioCodecError = fragErrorType === PlaylistLevelType.AUDIO && errorDetails === ErrorDetails.FRAG_PARSING_ERROR || data.sourceBufferName === 'audio' && (errorDetails === ErrorDetails.BUFFER_ADD_CODEC_ERROR || errorDetails === ErrorDetails.BUFFER_APPEND_ERROR);
3227
3228
  var findAudioCodecAlternate = isAudioCodecError && levels.some(function (_ref) {
@@ -3292,7 +3293,7 @@
3292
3293
  };
3293
3294
  _proto.onErrorOut = function onErrorOut(event, data) {
3294
3295
  var _data$errorAction;
3295
- switch ((_data$errorAction = data.errorAction) == null ? void 0 : _data$errorAction.action) {
3296
+ switch ((_data$errorAction = data.errorAction) == null ? undefined : _data$errorAction.action) {
3296
3297
  case NetworkErrorAction.DoNothing:
3297
3298
  break;
3298
3299
  case NetworkErrorAction.SendAlternateToPenaltyBox:
@@ -3371,7 +3372,7 @@
3371
3372
  this.fragments = Object.create(null);
3372
3373
  this.timeRanges = Object.create(null);
3373
3374
  this.bufferPadding = 0.2;
3374
- this.hls = void 0;
3375
+ this.hls = undefined;
3375
3376
  this.hasGaps = false;
3376
3377
  this.hls = hls;
3377
3378
  this._registerListeners();
@@ -3435,7 +3436,7 @@
3435
3436
  var keys = Object.keys(fragments);
3436
3437
  for (var i = keys.length; i--;) {
3437
3438
  var fragmentEntity = fragments[keys[i]];
3438
- if ((fragmentEntity == null ? void 0 : fragmentEntity.body.type) === levelType && (!buffered || fragmentEntity.buffered)) {
3439
+ if ((fragmentEntity == null ? undefined : fragmentEntity.body.type) === levelType && (!buffered || fragmentEntity.buffered)) {
3439
3440
  var frag = fragmentEntity.body;
3440
3441
  if (frag.start <= position && position <= frag.end) {
3441
3442
  return frag;
@@ -3457,7 +3458,7 @@
3457
3458
  }
3458
3459
  // Check if any flagged fragments have been unloaded
3459
3460
  // excluding anything newer than appendedPartSn
3460
- var appendedPartSn = (appendedPart == null ? void 0 : appendedPart.fragment.sn) || -1;
3461
+ var appendedPartSn = (appendedPart == null ? undefined : appendedPart.fragment.sn) || -1;
3461
3462
  Object.keys(this.fragments).forEach(function (key) {
3462
3463
  var fragmentEntity = _this.fragments[key];
3463
3464
  if (!fragmentEntity) {
@@ -3724,7 +3725,7 @@
3724
3725
  }
3725
3726
  for (var i = keys.length; i--;) {
3726
3727
  var fragmentEntity = fragments[keys[i]];
3727
- if ((fragmentEntity == null ? void 0 : fragmentEntity.body.type) === type) {
3728
+ if ((fragmentEntity == null ? undefined : fragmentEntity.body.type) === type) {
3728
3729
  return true;
3729
3730
  }
3730
3731
  }
@@ -3775,7 +3776,7 @@
3775
3776
  this.endListFragments = Object.create(null);
3776
3777
  this.activePartLists = Object.create(null);
3777
3778
  this.hasGaps = false;
3778
- var partlist = (_this$hls = this.hls) == null ? void 0 : (_this$hls$latestLevel = _this$hls.latestLevelDetails) == null ? void 0 : _this$hls$latestLevel.partList;
3779
+ var partlist = (_this$hls = this.hls) == null ? undefined : (_this$hls$latestLevel = _this$hls.latestLevelDetails) == null ? undefined : _this$hls$latestLevel.partList;
3779
3780
  if (partlist) {
3780
3781
  partlist.forEach(function (part) {
3781
3782
  return part.clearElementaryStreamInfo();
@@ -3786,7 +3787,7 @@
3786
3787
  }();
3787
3788
  function isPartial(fragmentEntity) {
3788
3789
  var _fragmentEntity$range, _fragmentEntity$range2, _fragmentEntity$range3;
3789
- 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));
3790
+ 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));
3790
3791
  }
3791
3792
  function getFragmentKey(fragment) {
3792
3793
  return fragment.type + "_" + fragment.level + "_" + fragment.sn;
@@ -3799,9 +3800,9 @@
3799
3800
 
3800
3801
  var AESCrypto = /*#__PURE__*/function () {
3801
3802
  function AESCrypto(subtle, iv, aesMode) {
3802
- this.subtle = void 0;
3803
- this.aesIV = void 0;
3804
- this.aesMode = void 0;
3803
+ this.subtle = undefined;
3804
+ this.aesIV = undefined;
3805
+ this.aesMode = undefined;
3805
3806
  this.subtle = subtle;
3806
3807
  this.aesIV = iv;
3807
3808
  this.aesMode = aesMode;
@@ -3854,8 +3855,8 @@
3854
3855
  this.key = new Uint32Array(0);
3855
3856
  this.ksRows = 0;
3856
3857
  this.keySize = 0;
3857
- this.keySchedule = void 0;
3858
- this.invKeySchedule = void 0;
3858
+ this.keySchedule = undefined;
3859
+ this.invKeySchedule = undefined;
3859
3860
  this.initTable();
3860
3861
  }
3861
3862
 
@@ -4072,9 +4073,9 @@
4072
4073
 
4073
4074
  var FastAESKey = /*#__PURE__*/function () {
4074
4075
  function FastAESKey(subtle, key, aesMode) {
4075
- this.subtle = void 0;
4076
- this.key = void 0;
4077
- this.aesMode = void 0;
4076
+ this.subtle = undefined;
4077
+ this.key = undefined;
4078
+ this.aesMode = undefined;
4078
4079
  this.subtle = subtle;
4079
4080
  this.key = key;
4080
4081
  this.aesMode = aesMode;
@@ -4120,7 +4121,7 @@
4120
4121
  * @beta
4121
4122
  */
4122
4123
  function utf8ArrayToStr(array, exitOnNull) {
4123
- if (exitOnNull === void 0) {
4124
+ if (exitOnNull === undefined) {
4124
4125
  exitOnNull = false;
4125
4126
  }
4126
4127
  if (typeof TextDecoder !== 'undefined') {
@@ -4230,9 +4231,9 @@
4230
4231
  this._stats = null;
4231
4232
  this._streams = null;
4232
4233
  // baseurl is the URL to the playlist
4233
- this.base = void 0;
4234
+ this.base = undefined;
4234
4235
  // relurl is the portion of the URL that comes from inside the playlist.
4235
- this.relurl = void 0;
4236
+ this.relurl = undefined;
4236
4237
  if (typeof base === 'string') {
4237
4238
  base = {
4238
4239
  url: base
@@ -4247,7 +4248,7 @@
4247
4248
  var params = value.split('@', 2);
4248
4249
  var start;
4249
4250
  if (params.length === 1) {
4250
- start = (previous == null ? void 0 : previous.byteRangeEndOffset) || 0;
4251
+ start = (previous == null ? undefined : previous.byteRangeEndOffset) || 0;
4251
4252
  } else {
4252
4253
  start = parseInt(params[1]);
4253
4254
  }
@@ -4345,7 +4346,7 @@
4345
4346
  _this._programDateTime = null;
4346
4347
  _this._ref = null;
4347
4348
  // Approximate bit rate of the fragment expressed in bits per second (bps) as indicated by the last EXT-X-BITRATE (kbps) tag
4348
- _this._bitrate = void 0;
4349
+ _this._bitrate = undefined;
4349
4350
  _this.rawProgramDateTime = null;
4350
4351
  _this.tagList = [];
4351
4352
  // EXTINF has to be present for a m3u8 to be considered valid
@@ -4355,9 +4356,9 @@
4355
4356
  // levelkeys are the EXT-X-KEY tags that apply to this segment for decryption
4356
4357
  // core difference from the private field _decryptdata is the lack of the initialized IV
4357
4358
  // _decryptdata will set the IV for this segment based on the segment number in the fragment
4358
- _this.levelkeys = void 0;
4359
+ _this.levelkeys = undefined;
4359
4360
  // A string representing the fragment type
4360
- _this.type = void 0;
4361
+ _this.type = undefined;
4361
4362
  // A reference to the loader. Set while the fragment is loading, and removed afterwards. Used to abort fragment loading
4362
4363
  _this.loader = null;
4363
4364
  // A reference to the key loader. Set while the key is loading, and removed afterwards. Used to abort key loading
@@ -4367,25 +4368,25 @@
4367
4368
  // The continuity counter of the fragment
4368
4369
  _this.cc = 0;
4369
4370
  // The starting Presentation Time Stamp (PTS) of the fragment. Set after transmux complete.
4370
- _this.startPTS = void 0;
4371
+ _this.startPTS = undefined;
4371
4372
  // The ending Presentation Time Stamp (PTS) of the fragment. Set after transmux complete.
4372
- _this.endPTS = void 0;
4373
+ _this.endPTS = undefined;
4373
4374
  // The starting Decode Time Stamp (DTS) of the fragment. Set after transmux complete.
4374
- _this.startDTS = void 0;
4375
+ _this.startDTS = undefined;
4375
4376
  // The ending Decode Time Stamp (DTS) of the fragment. Set after transmux complete.
4376
- _this.endDTS = void 0;
4377
+ _this.endDTS = undefined;
4377
4378
  // The start time of the fragment, as listed in the manifest. Updated after transmux complete.
4378
4379
  _this.start = 0;
4379
4380
  // The offset time (seconds) of the fragment from the start of the Playlist
4380
4381
  _this.playlistOffset = 0;
4381
4382
  // Set by `updateFragPTSDTS` in level-helper
4382
- _this.deltaPTS = void 0;
4383
+ _this.deltaPTS = undefined;
4383
4384
  // The maximum starting Presentation Time Stamp (audio/video PTS) of the fragment. Set after transmux complete.
4384
- _this.maxStartPTS = void 0;
4385
+ _this.maxStartPTS = undefined;
4385
4386
  // The minimum ending Presentation Time Stamp (audio/video PTS) of the fragment. Set after transmux complete.
4386
- _this.minEndPTS = void 0;
4387
+ _this.minEndPTS = undefined;
4387
4388
  // Init Segment bytes (unset for media segments)
4388
- _this.data = void 0;
4389
+ _this.data = undefined;
4389
4390
  // A flag indicating whether the segment was downloaded in order to test bitrate, and was not buffered
4390
4391
  _this.bitrateTest = false;
4391
4392
  // #EXTINF segment title
@@ -4393,9 +4394,9 @@
4393
4394
  // The Media Initialization Section for this segment
4394
4395
  _this.initSegment = null;
4395
4396
  // Fragment is the last fragment in the media playlist
4396
- _this.endList = void 0;
4397
+ _this.endList = undefined;
4397
4398
  // Fragment is marked by an EXT-X-GAP tag indicating that it does not contain media data and should not be loaded
4398
- _this.gap = void 0;
4399
+ _this.gap = undefined;
4399
4400
  // Deprecated
4400
4401
  _this.urlId = 0;
4401
4402
  _this.type = type;
@@ -4428,11 +4429,11 @@
4428
4429
  };
4429
4430
  _proto2.abortRequests = function abortRequests() {
4430
4431
  var _this$loader, _this$keyLoader;
4431
- (_this$loader = this.loader) == null ? void 0 : _this$loader.abort();
4432
- (_this$keyLoader = this.keyLoader) == null ? void 0 : _this$keyLoader.abort();
4432
+ (_this$loader = this.loader) == null ? undefined : _this$loader.abort();
4433
+ (_this$keyLoader = this.keyLoader) == null ? undefined : _this$keyLoader.abort();
4433
4434
  };
4434
4435
  _proto2.setElementaryStreamInfo = function setElementaryStreamInfo(type, startPTS, endPTS, startDTS, endDTS, partial) {
4435
- if (partial === void 0) {
4436
+ if (partial === undefined) {
4436
4437
  partial = false;
4437
4438
  }
4438
4439
  var elementaryStreams = this.elementaryStreams;
@@ -4582,9 +4583,9 @@
4582
4583
  _this2.duration = 0;
4583
4584
  _this2.gap = false;
4584
4585
  _this2.independent = false;
4585
- _this2.relurl = void 0;
4586
- _this2.fragment = void 0;
4587
- _this2.index = void 0;
4586
+ _this2.relurl = undefined;
4587
+ _this2.fragment = undefined;
4588
+ _this2.index = undefined;
4588
4589
  _this2.duration = partAttrs.decimalFloatingPoint('DURATION');
4589
4590
  _this2.gap = partAttrs.bool('GAP');
4590
4591
  _this2.independent = partAttrs.bool('INDEPENDENT');
@@ -5145,8 +5146,8 @@
5145
5146
  continue;
5146
5147
  }
5147
5148
  var trackDefault = track.default;
5148
- var tfhdFlags = readUint32(tfhd, 0) | (trackDefault == null ? void 0 : trackDefault.flags);
5149
- var sampleDuration = trackDefault == null ? void 0 : trackDefault.duration;
5149
+ var tfhdFlags = readUint32(tfhd, 0) | (trackDefault == null ? undefined : trackDefault.flags);
5150
+ var sampleDuration = trackDefault == null ? undefined : trackDefault.duration;
5150
5151
  if (tfhdFlags & 0x000008) {
5151
5152
  // 0x000008 indicates the presence of the default_sample_duration field
5152
5153
  if (tfhdFlags & 0x000002) {
@@ -5799,11 +5800,11 @@
5799
5800
  var CHUNK_SIZE = 16; // 16 bytes, 128 bits
5800
5801
  var Decrypter = /*#__PURE__*/function () {
5801
5802
  function Decrypter(config, _temp) {
5802
- var _ref = _temp === void 0 ? {} : _temp,
5803
+ var _ref = _temp === undefined ? {} : _temp,
5803
5804
  _ref$removePKCS7Paddi = _ref.removePKCS7Padding,
5804
- removePKCS7Padding = _ref$removePKCS7Paddi === void 0 ? true : _ref$removePKCS7Paddi;
5805
+ removePKCS7Padding = _ref$removePKCS7Paddi === undefined ? true : _ref$removePKCS7Paddi;
5805
5806
  this.logEnabled = true;
5806
- this.removePKCS7Padding = void 0;
5807
+ this.removePKCS7Padding = undefined;
5807
5808
  this.subtle = null;
5808
5809
  this.softwareDecrypter = null;
5809
5810
  this.key = null;
@@ -5811,8 +5812,8 @@
5811
5812
  this.remainderData = null;
5812
5813
  this.currentIV = null;
5813
5814
  this.currentResult = null;
5814
- this.useSoftware = void 0;
5815
- this.enableSoftwareAES = void 0;
5815
+ this.useSoftware = undefined;
5816
+ this.enableSoftwareAES = undefined;
5816
5817
  this.enableSoftwareAES = config.enableSoftwareAES;
5817
5818
  this.removePKCS7Padding = removePKCS7Padding;
5818
5819
  // built in decryptor expects PKCS7 padding
@@ -5980,7 +5981,7 @@
5980
5981
  var MIN_CHUNK_SIZE = Math.pow(2, 17); // 128kb
5981
5982
  var FragmentLoader = /*#__PURE__*/function () {
5982
5983
  function FragmentLoader(config) {
5983
- this.config = void 0;
5984
+ this.config = undefined;
5984
5985
  this.loader = null;
5985
5986
  this.partLoadTimeout = -1;
5986
5987
  this.config = config;
@@ -6238,7 +6239,7 @@
6238
6239
  return FragmentLoader;
6239
6240
  }();
6240
6241
  function createLoaderContext(frag, part) {
6241
- if (part === void 0) {
6242
+ if (part === undefined) {
6242
6243
  part = null;
6243
6244
  }
6244
6245
  var segment = part || frag;
@@ -6257,7 +6258,7 @@
6257
6258
  var _frag$decryptdata;
6258
6259
  var byteRangeStart = start;
6259
6260
  var byteRangeEnd = end;
6260
- if (frag.sn === 'initSegment' && isMethodFullSegmentAesCbc((_frag$decryptdata = frag.decryptdata) == null ? void 0 : _frag$decryptdata.method)) {
6261
+ if (frag.sn === 'initSegment' && isMethodFullSegmentAesCbc((_frag$decryptdata = frag.decryptdata) == null ? undefined : _frag$decryptdata.method)) {
6261
6262
  // MAP segment encrypted with method 'AES-128' or 'AES-256' (cbc), when served with HTTP Range,
6262
6263
  // has the unencrypted size specified in the range.
6263
6264
  // Ref: https://tools.ietf.org/html/draft-pantos-hls-rfc8216bis-08#section-6.3.6
@@ -6298,7 +6299,7 @@
6298
6299
  function LoadError(data) {
6299
6300
  var _this3;
6300
6301
  _this3 = _Error.call(this, data.error.message) || this;
6301
- _this3.data = void 0;
6302
+ _this3.data = undefined;
6302
6303
  _this3.data = data;
6303
6304
  return _this3;
6304
6305
  }
@@ -6339,7 +6340,7 @@
6339
6340
  function TaskLoop(label, logger) {
6340
6341
  var _this;
6341
6342
  _this = _Logger.call(this, label, logger) || this;
6342
- _this._boundTick = void 0;
6343
+ _this._boundTick = undefined;
6343
6344
  _this._tickTimer = null;
6344
6345
  _this._tickInterval = null;
6345
6346
  _this._tickCallCount = 0;
@@ -6434,21 +6435,21 @@
6434
6435
  }(Logger);
6435
6436
 
6436
6437
  var ChunkMetadata = function ChunkMetadata(level, sn, id, size, part, partial) {
6437
- if (size === void 0) {
6438
+ if (size === undefined) {
6438
6439
  size = 0;
6439
6440
  }
6440
- if (part === void 0) {
6441
+ if (part === undefined) {
6441
6442
  part = -1;
6442
6443
  }
6443
- if (partial === void 0) {
6444
+ if (partial === undefined) {
6444
6445
  partial = false;
6445
6446
  }
6446
- this.level = void 0;
6447
- this.sn = void 0;
6448
- this.part = void 0;
6449
- this.id = void 0;
6450
- this.size = void 0;
6451
- this.partial = void 0;
6447
+ this.level = undefined;
6448
+ this.sn = undefined;
6449
+ this.part = undefined;
6450
+ this.id = undefined;
6451
+ this.size = undefined;
6452
+ this.partial = undefined;
6452
6453
  this.transmuxing = getNewPerformanceTiming();
6453
6454
  this.buffering = {
6454
6455
  audio: getNewPerformanceTiming(),
@@ -6521,8 +6522,7 @@
6521
6522
  return {
6522
6523
  len: 0,
6523
6524
  start: pos,
6524
- end: pos,
6525
- nextStart: undefined
6525
+ end: pos
6526
6526
  };
6527
6527
  };
6528
6528
  BufferHelper.bufferedInfo = function bufferedInfo(buffered, pos, maxHoleDuration) {
@@ -6587,7 +6587,8 @@
6587
6587
  len: bufferLen,
6588
6588
  start: bufferStart || 0,
6589
6589
  end: bufferEnd || 0,
6590
- nextStart: bufferStartNext
6590
+ nextStart: bufferStartNext,
6591
+ buffered: buffered
6591
6592
  };
6592
6593
  }
6593
6594
 
@@ -6615,7 +6616,7 @@
6615
6616
  var variableList = parsed.variableList;
6616
6617
  return value.replace(VARIABLE_REPLACEMENT_REGEX, function (variableReference) {
6617
6618
  var variableName = variableReference.substring(2, variableReference.length - 1);
6618
- var variableValue = variableList == null ? void 0 : variableList[variableName];
6619
+ var variableValue = variableList == null ? undefined : variableList[variableName];
6619
6620
  if (variableValue === undefined) {
6620
6621
  parsed.playlistParsingError || (parsed.playlistParsingError = new Error("Missing preceding EXT-X-DEFINE tag for Variable Reference: \"" + variableName + "\""));
6621
6622
  return variableReference;
@@ -6831,19 +6832,19 @@
6831
6832
  var DateRange = /*#__PURE__*/function () {
6832
6833
  function DateRange(dateRangeAttr, dateRangeWithSameId, tagCount) {
6833
6834
  var _dateRangeWithSameId$;
6834
- if (tagCount === void 0) {
6835
+ if (tagCount === undefined) {
6835
6836
  tagCount = 0;
6836
6837
  }
6837
- this.attr = void 0;
6838
- this.tagAnchor = void 0;
6839
- this.tagOrder = void 0;
6840
- this._startDate = void 0;
6841
- this._endDate = void 0;
6842
- this._dateAtEnd = void 0;
6843
- this._cue = void 0;
6844
- this._badValueForSameId = void 0;
6845
- this.tagAnchor = (dateRangeWithSameId == null ? void 0 : dateRangeWithSameId.tagAnchor) || null;
6846
- this.tagOrder = (_dateRangeWithSameId$ = dateRangeWithSameId == null ? void 0 : dateRangeWithSameId.tagOrder) != null ? _dateRangeWithSameId$ : tagCount;
6838
+ this.attr = undefined;
6839
+ this.tagAnchor = undefined;
6840
+ this.tagOrder = undefined;
6841
+ this._startDate = undefined;
6842
+ this._endDate = undefined;
6843
+ this._dateAtEnd = undefined;
6844
+ this._cue = undefined;
6845
+ this._badValueForSameId = undefined;
6846
+ this.tagAnchor = (dateRangeWithSameId == null ? undefined : dateRangeWithSameId.tagAnchor) || null;
6847
+ this.tagOrder = (_dateRangeWithSameId$ = dateRangeWithSameId == null ? undefined : dateRangeWithSameId.tagOrder) != null ? _dateRangeWithSameId$ : tagCount;
6847
6848
  if (dateRangeWithSameId) {
6848
6849
  var previousAttr = dateRangeWithSameId.attr;
6849
6850
  for (var key in previousAttr) {
@@ -6866,7 +6867,7 @@
6866
6867
  this._startDate = new Date(dateRangeAttr["START-DATE"]);
6867
6868
  }
6868
6869
  if ("END-DATE" in this.attr) {
6869
- var endDate = (dateRangeWithSameId == null ? void 0 : dateRangeWithSameId.endDate) || new Date(this.attr["END-DATE"]);
6870
+ var endDate = (dateRangeWithSameId == null ? undefined : dateRangeWithSameId.endDate) || new Date(this.attr["END-DATE"]);
6870
6871
  if (isFiniteNumber(endDate.getTime())) {
6871
6872
  this._endDate = endDate;
6872
6873
  }
@@ -6972,21 +6973,21 @@
6972
6973
  function LevelDetails(baseUrl) {
6973
6974
  this.PTSKnown = false;
6974
6975
  this.alignedSliding = false;
6975
- this.averagetargetduration = void 0;
6976
+ this.averagetargetduration = undefined;
6976
6977
  this.endCC = 0;
6977
6978
  this.endSN = 0;
6978
- this.fragments = void 0;
6979
- this.fragmentHint = void 0;
6979
+ this.fragments = undefined;
6980
+ this.fragmentHint = undefined;
6980
6981
  this.partList = null;
6981
- this.dateRanges = void 0;
6982
+ this.dateRanges = undefined;
6982
6983
  this.dateRangeTagCount = 0;
6983
6984
  this.live = true;
6984
6985
  this.requestScheduled = -1;
6985
6986
  this.ageHeader = 0;
6986
- this.advancedDateTime = void 0;
6987
+ this.advancedDateTime = undefined;
6987
6988
  this.updated = true;
6988
6989
  this.advanced = true;
6989
- this.availabilityDelay = void 0;
6990
+ this.availabilityDelay = undefined;
6990
6991
  // Manifest reload synchronization
6991
6992
  this.misses = 0;
6992
6993
  this.startCC = 0;
@@ -6995,30 +6996,30 @@
6995
6996
  this.targetduration = 0;
6996
6997
  this.totalduration = 0;
6997
6998
  this.type = null;
6998
- this.url = void 0;
6999
+ this.url = undefined;
6999
7000
  this.m3u8 = '';
7000
7001
  this.version = null;
7001
7002
  this.canBlockReload = false;
7002
7003
  this.canSkipUntil = 0;
7003
7004
  this.canSkipDateRanges = false;
7004
7005
  this.skippedSegments = 0;
7005
- this.recentlyRemovedDateranges = void 0;
7006
+ this.recentlyRemovedDateranges = undefined;
7006
7007
  this.partHoldBack = 0;
7007
7008
  this.holdBack = 0;
7008
7009
  this.partTarget = 0;
7009
- this.preloadHint = void 0;
7010
- this.renditionReports = void 0;
7010
+ this.preloadHint = undefined;
7011
+ this.renditionReports = undefined;
7011
7012
  this.tuneInGoal = 0;
7012
- this.deltaUpdateFailed = void 0;
7013
+ this.deltaUpdateFailed = undefined;
7013
7014
  this.driftStartTime = 0;
7014
7015
  this.driftEndTime = 0;
7015
7016
  this.driftStart = 0;
7016
7017
  this.driftEnd = 0;
7017
- this.encryptedFragments = void 0;
7018
+ this.encryptedFragments = undefined;
7018
7019
  this.playlistParsingError = null;
7019
7020
  this.variableList = null;
7020
7021
  this.hasVariableRefs = false;
7021
- this.appliedTimelineOffset = void 0;
7022
+ this.appliedTimelineOffset = undefined;
7022
7023
  this.fragments = [];
7023
7024
  this.encryptedFragments = [];
7024
7025
  this.dateRanges = {};
@@ -7379,18 +7380,18 @@
7379
7380
  var keyUriToKeyIdMap = {};
7380
7381
  var LevelKey = /*#__PURE__*/function () {
7381
7382
  function LevelKey(method, uri, format, formatversions, iv) {
7382
- if (formatversions === void 0) {
7383
+ if (formatversions === undefined) {
7383
7384
  formatversions = [1];
7384
7385
  }
7385
- if (iv === void 0) {
7386
+ if (iv === undefined) {
7386
7387
  iv = null;
7387
7388
  }
7388
- this.uri = void 0;
7389
- this.method = void 0;
7390
- this.keyFormat = void 0;
7391
- this.keyFormatVersions = void 0;
7392
- this.encrypted = void 0;
7393
- this.isCommonEncryption = void 0;
7389
+ this.uri = undefined;
7390
+ this.method = undefined;
7391
+ this.keyFormat = undefined;
7392
+ this.keyFormatVersions = undefined;
7393
+ this.encrypted = undefined;
7394
+ this.isCommonEncryption = undefined;
7394
7395
  this.iv = null;
7395
7396
  this.key = null;
7396
7397
  this.keyId = null;
@@ -8102,7 +8103,7 @@
8102
8103
  var pdtStart = pdtFragment.programDateTime;
8103
8104
  if (startDateTime >= pdtStart || index === 0) {
8104
8105
  var _programDateTimes;
8105
- var durationBetweenPdt = (((_programDateTimes = programDateTimes[index + 1]) == null ? void 0 : _programDateTimes.start) || endTime) - pdtFragment.start;
8106
+ var durationBetweenPdt = (((_programDateTimes = programDateTimes[index + 1]) == null ? undefined : _programDateTimes.start) || endTime) - pdtFragment.start;
8106
8107
  if (startDateTime <= pdtStart + durationBetweenPdt * 1000) {
8107
8108
  // map to fragment with date-time range
8108
8109
  var startIndex = programDateTimes[index].sn - details.startSN;
@@ -8373,7 +8374,7 @@
8373
8374
  if (currentInitSegment) {
8374
8375
  fragmentsToCheck.forEach(function (frag) {
8375
8376
  var _currentInitSegment;
8376
- if (frag && (!frag.initSegment || frag.initSegment.relurl === ((_currentInitSegment = currentInitSegment) == null ? void 0 : _currentInitSegment.relurl))) {
8377
+ if (frag && (!frag.initSegment || frag.initSegment.relurl === ((_currentInitSegment = currentInitSegment) == null ? undefined : _currentInitSegment.relurl))) {
8377
8378
  frag.initSegment = currentInitSegment;
8378
8379
  }
8379
8380
  });
@@ -8518,7 +8519,7 @@
8518
8519
  }
8519
8520
  }
8520
8521
  function adjustSliding(oldDetails, newDetails, matchingStableVariantOrRendition) {
8521
- if (matchingStableVariantOrRendition === void 0) {
8522
+ if (matchingStableVariantOrRendition === undefined) {
8522
8523
  matchingStableVariantOrRendition = true;
8523
8524
  }
8524
8525
  var delta = newDetails.startSN + newDetails.skippedSegments - oldDetails.startSN;
@@ -8553,7 +8554,7 @@
8553
8554
  }
8554
8555
  }
8555
8556
  function computeReloadInterval(newDetails, distanceToLiveEdgeMs) {
8556
- if (distanceToLiveEdgeMs === void 0) {
8557
+ if (distanceToLiveEdgeMs === undefined) {
8557
8558
  distanceToLiveEdgeMs = Infinity;
8558
8559
  }
8559
8560
  var reloadInterval = 1000 * newDetails.targetduration;
@@ -8613,7 +8614,7 @@
8613
8614
  function reassignFragmentLevelIndexes(levels) {
8614
8615
  levels.forEach(function (level, index) {
8615
8616
  var _level$details;
8616
- var fragments = (_level$details = level.details) == null ? void 0 : _level$details.fragments;
8617
+ var fragments = (_level$details = level.details) == null ? undefined : _level$details.fragments;
8617
8618
  if (fragments) {
8618
8619
  fragments.forEach(function (fragment) {
8619
8620
  fragment.level = index;
@@ -8628,7 +8629,7 @@
8628
8629
  function findFirstFragWithCC(fragments, cc) {
8629
8630
  for (var i = 0, len = fragments.length; i < len; i++) {
8630
8631
  var _fragments$i;
8631
- if (((_fragments$i = fragments[i]) == null ? void 0 : _fragments$i.cc) === cc) {
8632
+ if (((_fragments$i = fragments[i]) == null ? undefined : _fragments$i.cc) === cc) {
8632
8633
  return fragments[i];
8633
8634
  }
8634
8635
  }
@@ -8790,16 +8791,16 @@
8790
8791
  function BaseStreamController(hls, fragmentTracker, keyLoader, logPrefix, playlistType) {
8791
8792
  var _this;
8792
8793
  _this = _TaskLoop.call(this, logPrefix, hls.logger) || this;
8793
- _this.hls = void 0;
8794
+ _this.hls = undefined;
8794
8795
  _this.fragPrevious = null;
8795
8796
  _this.fragCurrent = null;
8796
- _this.fragmentTracker = void 0;
8797
+ _this.fragmentTracker = undefined;
8797
8798
  _this.transmuxer = null;
8798
8799
  _this._state = State.STOPPED;
8799
- _this.playlistType = void 0;
8800
+ _this.playlistType = undefined;
8800
8801
  _this.media = null;
8801
8802
  _this.mediaBuffer = null;
8802
- _this.config = void 0;
8803
+ _this.config = undefined;
8803
8804
  _this.bitrateTest = false;
8804
8805
  _this.lastCurrentTime = 0;
8805
8806
  _this.nextLoadPosition = 0;
@@ -8807,15 +8808,15 @@
8807
8808
  _this.startTimeOffset = null;
8808
8809
  _this.retryDate = 0;
8809
8810
  _this.levels = null;
8810
- _this.fragmentLoader = void 0;
8811
- _this.keyLoader = void 0;
8811
+ _this.fragmentLoader = undefined;
8812
+ _this.keyLoader = undefined;
8812
8813
  _this.levelLastLoaded = null;
8813
8814
  _this.startFragRequested = false;
8814
- _this.decrypter = void 0;
8815
+ _this.decrypter = undefined;
8815
8816
  _this.initPTS = [];
8816
8817
  _this.buffering = true;
8817
8818
  _this.loadingParts = false;
8818
- _this.loopSn = void 0;
8819
+ _this.loopSn = undefined;
8819
8820
  _this.onMediaSeeking = function () {
8820
8821
  var _this2 = _this,
8821
8822
  config = _this2.config,
@@ -8976,7 +8977,7 @@
8976
8977
  _proto.getLevelDetails = function getLevelDetails() {
8977
8978
  if (this.levels && this.levelLastLoaded !== null) {
8978
8979
  var _this$levelLastLoaded;
8979
- return (_this$levelLastLoaded = this.levelLastLoaded) == null ? void 0 : _this$levelLastLoaded.details;
8980
+ return (_this$levelLastLoaded = this.levelLastLoaded) == null ? undefined : _this$levelLastLoaded.details;
8980
8981
  }
8981
8982
  };
8982
8983
  _proto.onMediaAttached = function onMediaAttached(event, data) {
@@ -9059,7 +9060,7 @@
9059
9060
  if (config.interstitialsController && config.enableInterstitialPlayback !== false && frag.type !== PlaylistLevelType.SUBTITLE) {
9060
9061
  // Do not load fragments outside the buffering schedule segment
9061
9062
  var interstitials = this.hls.interstitialsManager;
9062
- var bufferingItem = interstitials == null ? void 0 : interstitials.bufferingItem;
9063
+ var bufferingItem = interstitials == null ? undefined : interstitials.bufferingItem;
9063
9064
  if (bufferingItem) {
9064
9065
  var bufferingInterstitial = bufferingItem.event;
9065
9066
  if (bufferingInterstitial) {
@@ -9070,7 +9071,7 @@
9070
9071
  } else {
9071
9072
  var _level$details;
9072
9073
  // Limit fragment loading to media in schedule item
9073
- if (frag.end <= bufferingItem.start && ((_level$details = level.details) == null ? void 0 : _level$details.live) === false) {
9074
+ if (frag.end <= bufferingItem.start && ((_level$details = level.details) == null ? undefined : _level$details.live) === false) {
9074
9075
  // fragment ends by schedule item start
9075
9076
  return;
9076
9077
  }
@@ -9121,7 +9122,7 @@
9121
9122
  if (_this3.state === State.STOPPED || _this3.state === State.ERROR) {
9122
9123
  return;
9123
9124
  }
9124
- _this3.warn("Frag error: " + ((reason == null ? void 0 : reason.message) || reason));
9125
+ _this3.warn("Frag error: " + ((reason == null ? undefined : reason.message) || reason));
9125
9126
  _this3.resetFragmentLoading(fragment);
9126
9127
  });
9127
9128
  };
@@ -9140,7 +9141,7 @@
9140
9141
  if (backtracked === 1 || this.reduceMaxBufferLength(minForwardBufferLength, frag.duration)) {
9141
9142
  fragmentTracker.removeFragment(frag);
9142
9143
  }
9143
- } else if (((_this$mediaBuffer = this.mediaBuffer) == null ? void 0 : _this$mediaBuffer.buffered.length) === 0) {
9144
+ } else if (((_this$mediaBuffer = this.mediaBuffer) == null ? undefined : _this$mediaBuffer.buffered.length) === 0) {
9144
9145
  // Stop gap for bad tracker / buffer flush behavior
9145
9146
  fragmentTracker.removeAllFragments();
9146
9147
  } else if (fragmentTracker.hasParts(frag.type)) {
@@ -9173,10 +9174,10 @@
9173
9174
  };
9174
9175
  _proto.waitForLive = function waitForLive(levelInfo) {
9175
9176
  var details = levelInfo.details;
9176
- return (details == null ? void 0 : details.live) && details.type !== 'EVENT' && (this.levelLastLoaded !== levelInfo || details.expired);
9177
+ return (details == null ? undefined : details.live) && details.type !== 'EVENT' && (this.levelLastLoaded !== levelInfo || details.expired);
9177
9178
  };
9178
9179
  _proto.flushMainBuffer = function flushMainBuffer(startOffset, endOffset, type) {
9179
- if (type === void 0) {
9180
+ if (type === undefined) {
9180
9181
  type = null;
9181
9182
  }
9182
9183
  if (!(startOffset - endOffset)) {
@@ -9194,7 +9195,7 @@
9194
9195
  _proto._loadInitSegment = function _loadInitSegment(fragment, level) {
9195
9196
  var _this4 = this;
9196
9197
  this._doFragLoad(fragment, level).then(function (data) {
9197
- var frag = data == null ? void 0 : data.frag;
9198
+ var frag = data == null ? undefined : data.frag;
9198
9199
  if (!frag || _this4.fragContextChanged(frag) || !_this4.levels) {
9199
9200
  throw new Error('init load aborted');
9200
9201
  }
@@ -9275,7 +9276,7 @@
9275
9276
  return;
9276
9277
  }
9277
9278
  }
9278
- var level = (_this$levels = this.levels) == null ? void 0 : _this$levels[frag.level];
9279
+ var level = (_this$levels = this.levels) == null ? undefined : _this$levels[frag.level];
9279
9280
  if (level != null && level.fragmentError) {
9280
9281
  this.log("Resetting level fragment error count of " + level.fragmentError + " on frag buffered");
9281
9282
  level.fragmentError = 0;
@@ -9305,11 +9306,11 @@
9305
9306
  _proto._doFragLoad = function _doFragLoad(frag, level, targetBufferTime, progressCallback) {
9306
9307
  var _frag$decryptdata,
9307
9308
  _this5 = this;
9308
- if (targetBufferTime === void 0) {
9309
+ if (targetBufferTime === undefined) {
9309
9310
  targetBufferTime = null;
9310
9311
  }
9311
9312
  this.fragCurrent = frag;
9312
- var details = level == null ? void 0 : level.details;
9313
+ var details = level == null ? undefined : level.details;
9313
9314
  if (!this.levels || !details) {
9314
9315
  throw new Error("frag load aborted, missing level" + (details ? '' : ' detail') + "s");
9315
9316
  }
@@ -9340,7 +9341,7 @@
9340
9341
  if (isMediaFragment(frag) && (!fragPrevious || frag.sn !== fragPrevious.sn)) {
9341
9342
  var shouldLoadParts = this.shouldLoadParts(level.details, frag.end);
9342
9343
  if (shouldLoadParts !== this.loadingParts) {
9343
- this.log("LL-Part loading " + (shouldLoadParts ? 'ON' : 'OFF') + " loading sn " + (fragPrevious == null ? void 0 : fragPrevious.sn) + "->" + frag.sn);
9344
+ this.log("LL-Part loading " + (shouldLoadParts ? 'ON' : 'OFF') + " loading sn " + (fragPrevious == null ? undefined : fragPrevious.sn) + "->" + frag.sn);
9344
9345
  this.loadingParts = shouldLoadParts;
9345
9346
  }
9346
9347
  }
@@ -9407,7 +9408,7 @@
9407
9408
  var result;
9408
9409
  if (dataOnProgress && keyLoadingPromise) {
9409
9410
  result = keyLoadingPromise.then(function (keyLoadedData) {
9410
- if (!keyLoadedData || _this5.fragContextChanged(keyLoadedData == null ? void 0 : keyLoadedData.frag)) {
9411
+ if (!keyLoadedData || _this5.fragContextChanged(keyLoadedData == null ? undefined : keyLoadedData.frag)) {
9411
9412
  return null;
9412
9413
  }
9413
9414
  return _this5.fragmentLoader.load(frag, progressCallback);
@@ -9441,7 +9442,7 @@
9441
9442
  return new Promise(function (resolve, reject) {
9442
9443
  var _level$details2;
9443
9444
  var partsLoaded = [];
9444
- var initialPartList = (_level$details2 = level.details) == null ? void 0 : _level$details2.partList;
9445
+ var initialPartList = (_level$details2 = level.details) == null ? undefined : _level$details2.partList;
9445
9446
  var _loadPart = function loadPart(part) {
9446
9447
  _this6.fragmentLoader.loadPart(frag, part, progressCallback).then(function (partLoadedData) {
9447
9448
  partsLoaded[part.index] = partLoadedData;
@@ -9517,10 +9518,10 @@
9517
9518
  // Buffer must be ahead of first part + duration of parts after last segment
9518
9519
  // and playback must be at or past segment adjacent to part list
9519
9520
  var firstPart = details.partList[0];
9520
- var safePartStart = firstPart.end + (((_details$fragmentHint = details.fragmentHint) == null ? void 0 : _details$fragmentHint.duration) || 0);
9521
+ var safePartStart = firstPart.end + (((_details$fragmentHint = details.fragmentHint) == null ? undefined : _details$fragmentHint.duration) || 0);
9521
9522
  if (bufferEnd >= safePartStart) {
9522
9523
  var _this$media;
9523
- var playhead = this.hls.hasEnoughToStart ? ((_this$media = this.media) == null ? void 0 : _this$media.currentTime) || this.lastCurrentTime : this.getLoadPosition();
9524
+ var playhead = this.hls.hasEnoughToStart ? ((_this$media = this.media) == null ? undefined : _this$media.currentTime) || this.lastCurrentTime : this.getLoadPosition();
9524
9525
  if (playhead > firstPart.start - firstPart.fragment.duration) {
9525
9526
  return true;
9526
9527
  }
@@ -9652,10 +9653,10 @@
9652
9653
  };
9653
9654
  _proto.getAppendedFrag = function getAppendedFrag(position, playlistType) {
9654
9655
  var _this$fragmentTracker;
9655
- if (playlistType === void 0) {
9656
+ if (playlistType === undefined) {
9656
9657
  playlistType = PlaylistLevelType.MAIN;
9657
9658
  }
9658
- var fragOrPart = (_this$fragmentTracker = this.fragmentTracker) == null ? void 0 : _this$fragmentTracker.getAppendedFrag(position, playlistType);
9659
+ var fragOrPart = (_this$fragmentTracker = this.fragmentTracker) == null ? undefined : _this$fragmentTracker.getAppendedFrag(position, playlistType);
9659
9660
  if (fragOrPart && 'fragment' in fragOrPart) {
9660
9661
  return fragOrPart.fragment;
9661
9662
  }
@@ -9693,7 +9694,7 @@
9693
9694
  var mainStart = this.hls.startPosition;
9694
9695
  var liveSyncPosition = this.hls.liveSyncPosition;
9695
9696
  var startPosition = frag ? (mainStart !== -1 && mainStart >= start ? mainStart : liveSyncPosition) || frag.start : pos;
9696
- this.log("Setting startPosition to " + startPosition + " to match initial live edge. mainStart: " + mainStart + " liveSyncPosition: " + liveSyncPosition + " frag.start: " + ((_frag = frag) == null ? void 0 : _frag.start));
9697
+ this.log("Setting startPosition to " + startPosition + " to match initial live edge. mainStart: " + mainStart + " liveSyncPosition: " + liveSyncPosition + " frag.start: " + ((_frag = frag) == null ? undefined : _frag.start));
9697
9698
  this.startPosition = this.nextLoadPosition = startPosition;
9698
9699
  }
9699
9700
  } else if (pos <= start) {
@@ -9955,7 +9956,7 @@
9955
9956
  }
9956
9957
  if (this.fragContextChanged(frag)) {
9957
9958
  var _this$fragCurrent;
9958
- this.warn("Frag load error must match current frag to retry " + frag.url + " > " + ((_this$fragCurrent = this.fragCurrent) == null ? void 0 : _this$fragCurrent.url));
9959
+ this.warn("Frag load error must match current frag to retry " + frag.url + " > " + ((_this$fragCurrent = this.fragCurrent) == null ? undefined : _this$fragCurrent.url));
9959
9960
  return;
9960
9961
  }
9961
9962
  var gapTagEncountered = data.details === ErrorDetails.FRAG_GAP;
@@ -9968,7 +9969,7 @@
9968
9969
  action = _ref2.action,
9969
9970
  flags = _ref2.flags,
9970
9971
  _ref2$retryCount = _ref2.retryCount,
9971
- retryCount = _ref2$retryCount === void 0 ? 0 : _ref2$retryCount,
9972
+ retryCount = _ref2$retryCount === undefined ? 0 : _ref2$retryCount,
9972
9973
  retryConfig = _ref2.retryConfig;
9973
9974
  var couldRetry = !!errorAction && !!retryConfig;
9974
9975
  var retry = couldRetry && action === NetworkErrorAction.RetryRequest;
@@ -10013,7 +10014,7 @@
10013
10014
  // reduce max buf len if current position is buffered
10014
10015
  var buffered = bufferedInfo && bufferedInfo.len > 0.5;
10015
10016
  if (buffered) {
10016
- this.reduceMaxBufferLength(bufferedInfo.len, (frag == null ? void 0 : frag.duration) || 10);
10017
+ this.reduceMaxBufferLength(bufferedInfo.len, (frag == null ? undefined : frag.duration) || 10);
10017
10018
  }
10018
10019
  var flushBuffer = !buffered;
10019
10020
  if (flushBuffer) {
@@ -10089,7 +10090,7 @@
10089
10090
  this.resetLoadingState();
10090
10091
  };
10091
10092
  _proto.removeUnbufferedFrags = function removeUnbufferedFrags(start) {
10092
- if (start === void 0) {
10093
+ if (start === undefined) {
10093
10094
  start = 0;
10094
10095
  }
10095
10096
  this.fragmentTracker.removeFragmentsInRange(start, Infinity, this.playlistType, false, true);
@@ -10127,7 +10128,7 @@
10127
10128
  }
10128
10129
  return result;
10129
10130
  }, false);
10130
- if (!parsed && ((_this$transmuxer = this.transmuxer) == null ? void 0 : _this$transmuxer.error) === null) {
10131
+ if (!parsed && ((_this$transmuxer = this.transmuxer) == null ? undefined : _this$transmuxer.error) === null) {
10131
10132
  var error = new Error("Found no media in fragment " + frag.sn + " of " + this.playlistLabel() + " " + frag.level + " resetting transmuxer to fallback to playlist timing");
10132
10133
  if (level.fragmentError === 0) {
10133
10134
  // Mark and track the odd empty segment as a gap to avoid reloading
@@ -10160,7 +10161,7 @@
10160
10161
  };
10161
10162
  _proto.fragInfo = function fragInfo(frag, pts, part) {
10162
10163
  var _ref3, _ref4;
10163
- if (pts === void 0) {
10164
+ if (pts === undefined) {
10164
10165
  pts = true;
10165
10166
  }
10166
10167
  return this.playlistLabel() + " " + frag.level + " (" + (part ? 'part' : 'frag') + ":[" + ((_ref3 = pts && !part ? frag.startPTS : (part || frag).start) != null ? _ref3 : NaN).toFixed(3) + "-" + ((_ref4 = pts && !part ? frag.endPTS : (part || frag).end) != null ? _ref4 : NaN).toFixed(3) + "]" + (part && frag.type === 'main' ? 'INDEPENDENT=' + (part.independent ? 'YES' : 'NO') : '');
@@ -10175,7 +10176,7 @@
10175
10176
  };
10176
10177
  _proto.resetTransmuxer = function resetTransmuxer() {
10177
10178
  var _this$transmuxer2;
10178
- (_this$transmuxer2 = this.transmuxer) == null ? void 0 : _this$transmuxer2.reset();
10179
+ (_this$transmuxer2 = this.transmuxer) == null ? undefined : _this$transmuxer2.reset();
10179
10180
  };
10180
10181
  _proto.recoverWorkerError = function recoverWorkerError(data) {
10181
10182
  if (data.event === 'demuxerWorker') {
@@ -10700,10 +10701,10 @@
10700
10701
  }
10701
10702
 
10702
10703
  function toUint8(data, offset, length) {
10703
- if (offset === void 0) {
10704
+ if (offset === undefined) {
10704
10705
  offset = 0;
10705
10706
  }
10706
- if (length === void 0) {
10707
+ if (length === undefined) {
10707
10708
  length = Infinity;
10708
10709
  }
10709
10710
  return view(data, offset, length, Uint8Array);
@@ -11029,10 +11030,10 @@
11029
11030
  }({});
11030
11031
 
11031
11032
  function dummyTrack(type, inputTimeScale) {
11032
- if (type === void 0) {
11033
+ if (type === undefined) {
11033
11034
  type = '';
11034
11035
  }
11035
- if (inputTimeScale === void 0) {
11036
+ if (inputTimeScale === undefined) {
11036
11037
  inputTimeScale = 90000;
11037
11038
  }
11038
11039
  return {
@@ -11048,8 +11049,8 @@
11048
11049
 
11049
11050
  var BaseAudioDemuxer = /*#__PURE__*/function () {
11050
11051
  function BaseAudioDemuxer() {
11051
- this._audioTrack = void 0;
11052
- this._id3Track = void 0;
11052
+ this._audioTrack = undefined;
11053
+ this._id3Track = undefined;
11053
11054
  this.frameIndex = 0;
11054
11055
  this.cachedData = null;
11055
11056
  this.basePTS = null;
@@ -11341,8 +11342,8 @@
11341
11342
  function AACDemuxer(observer, config) {
11342
11343
  var _this;
11343
11344
  _this = _BaseAudioDemuxer.call(this) || this;
11344
- _this.observer = void 0;
11345
- _this.config = void 0;
11345
+ _this.observer = undefined;
11346
+ _this.config = undefined;
11346
11347
  _this.observer = observer;
11347
11348
  _this.config = config;
11348
11349
  return _this;
@@ -11378,7 +11379,7 @@
11378
11379
  // Layer bits (position 14 and 15) in header should be always 0 for ADTS
11379
11380
  // More info https://wiki.multimedia.cx/index.php?title=ADTS
11380
11381
  var id3Data = getId3Data(data, 0);
11381
- var offset = (id3Data == null ? void 0 : id3Data.length) || 0;
11382
+ var offset = (id3Data == null ? undefined : id3Data.length) || 0;
11382
11383
  if (probe(data, offset)) {
11383
11384
  return false;
11384
11385
  }
@@ -11429,7 +11430,7 @@
11429
11430
  function AC3Demuxer(observer) {
11430
11431
  var _this;
11431
11432
  _this = _BaseAudioDemuxer.call(this) || this;
11432
- _this.observer = void 0;
11433
+ _this.observer = undefined;
11433
11434
  _this.observer = observer;
11434
11435
  return _this;
11435
11436
  }
@@ -11575,7 +11576,7 @@
11575
11576
  // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)
11576
11577
  // More info http://www.mp3-tech.org/programmer/frame_header.html
11577
11578
  var id3Data = getId3Data(data, 0);
11578
- var offset = (id3Data == null ? void 0 : id3Data.length) || 0;
11579
+ var offset = (id3Data == null ? undefined : id3Data.length) || 0;
11579
11580
 
11580
11581
  // Check for ac-3|ec-3 sync bytes and return false if present
11581
11582
  if (id3Data && data[offset] === 0x0b && data[offset + 1] === 0x77 && getId3Timestamp(id3Data) !== undefined &&
@@ -11608,11 +11609,11 @@
11608
11609
  function MP4Demuxer(observer, config) {
11609
11610
  this.remainderData = null;
11610
11611
  this.timeOffset = 0;
11611
- this.config = void 0;
11612
- this.videoTrack = void 0;
11613
- this.audioTrack = void 0;
11614
- this.id3Track = void 0;
11615
- this.txtTrack = void 0;
11612
+ this.config = undefined;
11613
+ this.videoTrack = undefined;
11614
+ this.audioTrack = undefined;
11615
+ this.id3Track = undefined;
11616
+ this.txtTrack = undefined;
11616
11617
  this.config = config;
11617
11618
  }
11618
11619
  var _proto = MP4Demuxer.prototype;
@@ -11759,8 +11760,8 @@
11759
11760
 
11760
11761
  var SampleAesDecrypter = /*#__PURE__*/function () {
11761
11762
  function SampleAesDecrypter(observer, config, keyData) {
11762
- this.keyData = void 0;
11763
- this.decrypter = void 0;
11763
+ this.keyData = undefined;
11764
+ this.decrypter = undefined;
11764
11765
  this.keyData = keyData;
11765
11766
  this.decrypter = new Decrypter(config, {
11766
11767
  removePKCS7Padding: false
@@ -12026,10 +12027,10 @@
12026
12027
 
12027
12028
  var ExpGolomb = /*#__PURE__*/function () {
12028
12029
  function ExpGolomb(data) {
12029
- this.data = void 0;
12030
- this.bytesAvailable = void 0;
12031
- this.word = void 0;
12032
- this.bitsAvailable = void 0;
12030
+ this.data = undefined;
12031
+ this.bytesAvailable = undefined;
12032
+ this.word = undefined;
12033
+ this.bitsAvailable = undefined;
12033
12034
  this.data = data;
12034
12035
  // the number of bytes left to examine in this.data
12035
12036
  this.bytesAvailable = data.byteLength;
@@ -12263,7 +12264,7 @@
12263
12264
  spsfound = true;
12264
12265
  var sps = unit.data;
12265
12266
  var config = _this.readSPS(sps);
12266
- 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]) {
12267
+ 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]) {
12267
12268
  track.width = config.width;
12268
12269
  track.height = config.height;
12269
12270
  track.pixelRatio = config.pixelRatio;
@@ -13121,22 +13122,22 @@
13121
13122
  var PACKET_LENGTH = 188;
13122
13123
  var TSDemuxer = /*#__PURE__*/function () {
13123
13124
  function TSDemuxer(observer, config, typeSupported, logger) {
13124
- this.logger = void 0;
13125
- this.observer = void 0;
13126
- this.config = void 0;
13127
- this.typeSupported = void 0;
13125
+ this.logger = undefined;
13126
+ this.observer = undefined;
13127
+ this.config = undefined;
13128
+ this.typeSupported = undefined;
13128
13129
  this.sampleAes = null;
13129
13130
  this.pmtParsed = false;
13130
- this.audioCodec = void 0;
13131
- this.videoCodec = void 0;
13131
+ this.audioCodec = undefined;
13132
+ this.videoCodec = undefined;
13132
13133
  this._pmtId = -1;
13133
- this._videoTrack = void 0;
13134
- this._audioTrack = void 0;
13135
- this._id3Track = void 0;
13136
- this._txtTrack = void 0;
13134
+ this._videoTrack = undefined;
13135
+ this._audioTrack = undefined;
13136
+ this._id3Track = undefined;
13137
+ this._txtTrack = undefined;
13137
13138
  this.aacOverFlow = null;
13138
13139
  this.remainderData = null;
13139
- this.videoParser = void 0;
13140
+ this.videoParser = undefined;
13140
13141
  this.observer = observer;
13141
13142
  this.config = config;
13142
13143
  this.typeSupported = typeSupported;
@@ -13244,10 +13245,10 @@
13244
13245
  this.remainderData = null;
13245
13246
  };
13246
13247
  _proto.demux = function demux(data, timeOffset, isSampleAes, flush) {
13247
- if (isSampleAes === void 0) {
13248
+ if (isSampleAes === undefined) {
13248
13249
  isSampleAes = false;
13249
13250
  }
13250
- if (flush === void 0) {
13251
+ if (flush === undefined) {
13251
13252
  flush = false;
13252
13253
  }
13253
13254
  if (!isSampleAes) {
@@ -13297,7 +13298,7 @@
13297
13298
  var atf = (data[start + 3] & 0x30) >> 4;
13298
13299
 
13299
13300
  // if an adaption field is present, its length is specified by the fifth byte of the TS packet header.
13300
- var offset = void 0;
13301
+ var offset = undefined;
13301
13302
  if (atf > 1) {
13302
13303
  offset = start + 5 + data[start + 4];
13303
13304
  // continue if there is only adaptation field
@@ -14675,34 +14676,34 @@
14675
14676
  };
14676
14677
  return MP4;
14677
14678
  }();
14678
- MP4.types = void 0;
14679
- MP4.HDLR_TYPES = void 0;
14680
- MP4.STTS = void 0;
14681
- MP4.STSC = void 0;
14682
- MP4.STCO = void 0;
14683
- MP4.STSZ = void 0;
14684
- MP4.VMHD = void 0;
14685
- MP4.SMHD = void 0;
14686
- MP4.STSD = void 0;
14687
- MP4.FTYP = void 0;
14688
- MP4.DINF = void 0;
14679
+ MP4.types = undefined;
14680
+ MP4.HDLR_TYPES = undefined;
14681
+ MP4.STTS = undefined;
14682
+ MP4.STSC = undefined;
14683
+ MP4.STCO = undefined;
14684
+ MP4.STSZ = undefined;
14685
+ MP4.VMHD = undefined;
14686
+ MP4.SMHD = undefined;
14687
+ MP4.STSD = undefined;
14688
+ MP4.FTYP = undefined;
14689
+ MP4.DINF = undefined;
14689
14690
 
14690
14691
  var MPEG_TS_CLOCK_FREQ_HZ = 90000;
14691
14692
  function toTimescaleFromBase(baseTime, destScale, srcBase, round) {
14692
- if (srcBase === void 0) {
14693
+ if (srcBase === undefined) {
14693
14694
  srcBase = 1;
14694
14695
  }
14695
- if (round === void 0) {
14696
+ if (round === undefined) {
14696
14697
  round = false;
14697
14698
  }
14698
14699
  var result = baseTime * destScale * srcBase; // equivalent to `(value * scale) / (1 / base)`
14699
14700
  return round ? Math.round(result) : result;
14700
14701
  }
14701
14702
  function toTimescaleFromScale(baseTime, destScale, srcScale, round) {
14702
- if (srcScale === void 0) {
14703
+ if (srcScale === undefined) {
14703
14704
  srcScale = 1;
14704
14705
  }
14705
- if (round === void 0) {
14706
+ if (round === undefined) {
14706
14707
  round = false;
14707
14708
  }
14708
14709
  return toTimescaleFromBase(baseTime, destScale, 1 / srcScale, round);
@@ -14711,7 +14712,7 @@
14711
14712
  return toTimescaleFromBase(baseTime, 1000, 1 / MPEG_TS_CLOCK_FREQ_HZ, round);
14712
14713
  }
14713
14714
  function toMpegTsClockFromTimescale(baseTime, srcScale) {
14714
- if (srcScale === void 0) {
14715
+ if (srcScale === undefined) {
14715
14716
  srcScale = 1;
14716
14717
  }
14717
14718
  return toTimescaleFromBase(baseTime, MPEG_TS_CLOCK_FREQ_HZ, 1 / srcScale);
@@ -14740,10 +14741,10 @@
14740
14741
  }
14741
14742
  var MP4Remuxer = /*#__PURE__*/function () {
14742
14743
  function MP4Remuxer(observer, config, typeSupported, logger) {
14743
- this.logger = void 0;
14744
- this.observer = void 0;
14745
- this.config = void 0;
14746
- this.typeSupported = void 0;
14744
+ this.logger = undefined;
14745
+ this.observer = undefined;
14746
+ this.config = undefined;
14747
+ this.typeSupported = undefined;
14747
14748
  this.ISGenerated = false;
14748
14749
  this._initPTS = null;
14749
14750
  this._initDTS = null;
@@ -14752,7 +14753,7 @@
14752
14753
  this.videoSampleDuration = null;
14753
14754
  this.isAudioContiguous = false;
14754
14755
  this.isVideoContiguous = false;
14755
- this.videoTrackConfig = void 0;
14756
+ this.videoTrackConfig = undefined;
14756
14757
  this.observer = observer;
14757
14758
  this.config = config;
14758
14759
  this.typeSupported = typeSupported;
@@ -14835,7 +14836,7 @@
14835
14836
  if (this.ISGenerated) {
14836
14837
  var _videoTrack$pixelRati, _config$pixelRatio, _videoTrack$pixelRati2, _config$pixelRatio2;
14837
14838
  var config = this.videoTrackConfig;
14838
- 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) {
14839
+ 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) {
14839
14840
  this.resetInitSegment();
14840
14841
  }
14841
14842
  }
@@ -15199,7 +15200,7 @@
15199
15200
  }
15200
15201
 
15201
15202
  // expected sample duration is the Decoding Timestamp diff of consecutive samples
15202
- var ptsDelta = void 0;
15203
+ var ptsDelta = undefined;
15203
15204
  if (_i3 < nbSamples - 1) {
15204
15205
  mp4SampleDuration = inputSamples[_i3 + 1].dts - VideoSample.dts;
15205
15206
  ptsDelta = inputSamples[_i3 + 1].pts - VideoSample.pts;
@@ -15590,13 +15591,13 @@
15590
15591
 
15591
15592
  var PassThroughRemuxer = /*#__PURE__*/function () {
15592
15593
  function PassThroughRemuxer(observer, config, typeSupported, logger) {
15593
- this.logger = void 0;
15594
+ this.logger = undefined;
15594
15595
  this.emitInitSegment = false;
15595
- this.audioCodec = void 0;
15596
- this.videoCodec = void 0;
15597
- this.initData = void 0;
15596
+ this.audioCodec = undefined;
15597
+ this.videoCodec = undefined;
15598
+ this.initData = undefined;
15598
15599
  this.initPTS = null;
15599
- this.initTracks = void 0;
15600
+ this.initTracks = undefined;
15600
15601
  this.lastEndTime = null;
15601
15602
  this.logger = logger;
15602
15603
  }
@@ -15766,7 +15767,7 @@
15766
15767
  return Math.abs(startTime - timeOffset) > minDuration;
15767
15768
  }
15768
15769
  function getParsedTrackCodec(track, type) {
15769
- var parsedCodec = track == null ? void 0 : track.codec;
15770
+ var parsedCodec = track == null ? undefined : track.codec;
15770
15771
  if (parsedCodec && parsedCodec.length > 4) {
15771
15772
  return parsedCodec;
15772
15773
  }
@@ -15817,18 +15818,18 @@
15817
15818
  var Transmuxer = /*#__PURE__*/function () {
15818
15819
  function Transmuxer(observer, typeSupported, config, vendor, id, logger) {
15819
15820
  this.asyncResult = false;
15820
- this.logger = void 0;
15821
- this.observer = void 0;
15822
- this.typeSupported = void 0;
15823
- this.config = void 0;
15824
- this.id = void 0;
15825
- this.demuxer = void 0;
15826
- this.remuxer = void 0;
15827
- this.decrypter = void 0;
15828
- this.probe = void 0;
15821
+ this.logger = undefined;
15822
+ this.observer = undefined;
15823
+ this.typeSupported = undefined;
15824
+ this.config = undefined;
15825
+ this.id = undefined;
15826
+ this.demuxer = undefined;
15827
+ this.remuxer = undefined;
15828
+ this.decrypter = undefined;
15829
+ this.probe = undefined;
15829
15830
  this.decryptionPromise = null;
15830
- this.transmuxConfig = void 0;
15831
- this.currentTransmuxState = void 0;
15831
+ this.transmuxConfig = undefined;
15832
+ this.currentTransmuxState = undefined;
15832
15833
  this.observer = observer;
15833
15834
  this.typeSupported = typeSupported;
15834
15835
  this.config = config;
@@ -16116,7 +16117,7 @@
16116
16117
  }();
16117
16118
  function getEncryptionType(data, decryptData) {
16118
16119
  var encryptionType = null;
16119
- if (data.byteLength > 0 && (decryptData == null ? void 0 : decryptData.key) != null && decryptData.iv !== null && decryptData.method != null) {
16120
+ if (data.byteLength > 0 && (decryptData == null ? undefined : decryptData.key) != null && decryptData.iv !== null && decryptData.method != null) {
16120
16121
  encryptionType = decryptData;
16121
16122
  }
16122
16123
  return encryptionType;
@@ -16131,11 +16132,11 @@
16131
16132
  return 'then' in p && p.then instanceof Function;
16132
16133
  }
16133
16134
  var TransmuxConfig = function TransmuxConfig(audioCodec, videoCodec, initSegmentData, duration, defaultInitPts) {
16134
- this.audioCodec = void 0;
16135
- this.videoCodec = void 0;
16136
- this.initSegmentData = void 0;
16137
- this.duration = void 0;
16138
- this.defaultInitPts = void 0;
16135
+ this.audioCodec = undefined;
16136
+ this.videoCodec = undefined;
16137
+ this.initSegmentData = undefined;
16138
+ this.duration = undefined;
16139
+ this.defaultInitPts = undefined;
16139
16140
  this.audioCodec = audioCodec;
16140
16141
  this.videoCodec = videoCodec;
16141
16142
  this.initSegmentData = initSegmentData;
@@ -16143,12 +16144,12 @@
16143
16144
  this.defaultInitPts = defaultInitPts || null;
16144
16145
  };
16145
16146
  var TransmuxState = function TransmuxState(discontinuity, contiguous, accurateTimeOffset, trackSwitch, timeOffset, initSegmentChange) {
16146
- this.discontinuity = void 0;
16147
- this.contiguous = void 0;
16148
- this.accurateTimeOffset = void 0;
16149
- this.trackSwitch = void 0;
16150
- this.timeOffset = void 0;
16151
- this.initSegmentChange = void 0;
16147
+ this.discontinuity = undefined;
16148
+ this.contiguous = undefined;
16149
+ this.accurateTimeOffset = undefined;
16150
+ this.trackSwitch = undefined;
16151
+ this.timeOffset = undefined;
16152
+ this.initSegmentChange = undefined;
16152
16153
  this.discontinuity = discontinuity;
16153
16154
  this.contiguous = contiguous;
16154
16155
  this.accurateTimeOffset = accurateTimeOffset;
@@ -16320,7 +16321,7 @@
16320
16321
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
16321
16322
  }
16322
16323
 
16323
- var version = "1.6.0-beta.2.0.canary.10880";
16324
+ var version = "1.6.0-beta.2.0.canary.10883";
16324
16325
 
16325
16326
  // ensure the worker ends up in the bundle
16326
16327
  // If the worker should not be included this gets aliased to empty.js
@@ -16385,17 +16386,17 @@
16385
16386
  function TransmuxerInterface(_hls, id, onTransmuxComplete, onFlush) {
16386
16387
  var _this = this;
16387
16388
  this.error = null;
16388
- this.hls = void 0;
16389
- this.id = void 0;
16389
+ this.hls = undefined;
16390
+ this.id = undefined;
16390
16391
  this.instanceNo = transmuxerInstanceCount++;
16391
- this.observer = void 0;
16392
+ this.observer = undefined;
16392
16393
  this.frag = null;
16393
16394
  this.part = null;
16394
- this.useWorker = void 0;
16395
+ this.useWorker = undefined;
16395
16396
  this.workerContext = null;
16396
16397
  this.transmuxer = null;
16397
- this.onTransmuxComplete = void 0;
16398
- this.onFlush = void 0;
16398
+ this.onTransmuxComplete = undefined;
16399
+ this.onFlush = undefined;
16399
16400
  this.onWorkerMessage = function (event) {
16400
16401
  var data = event.data;
16401
16402
  var hls = _this.hls;
@@ -16406,7 +16407,7 @@
16406
16407
  case 'init':
16407
16408
  {
16408
16409
  var _this$workerContext;
16409
- var objectURL = (_this$workerContext = _this.workerContext) == null ? void 0 : _this$workerContext.objectURL;
16410
+ var objectURL = (_this$workerContext = _this.workerContext) == null ? undefined : _this$workerContext.objectURL;
16410
16411
  if (objectURL) {
16411
16412
  // revoke the Object URL that was used to create transmuxer worker, so as not to leak it
16412
16413
  self.URL.revokeObjectURL(objectURL);
@@ -16580,7 +16581,7 @@
16580
16581
  var trackSwitch = !(lastFrag && chunkMeta.level === lastFrag.level);
16581
16582
  var snDiff = lastFrag ? chunkMeta.sn - lastFrag.sn : -1;
16582
16583
  var partDiff = this.part ? chunkMeta.part - this.part.index : -1;
16583
- var progressive = snDiff === 0 && chunkMeta.id > 1 && chunkMeta.id === (lastFrag == null ? void 0 : lastFrag.stats.chunkCount);
16584
+ var progressive = snDiff === 0 && chunkMeta.id > 1 && chunkMeta.id === (lastFrag == null ? undefined : lastFrag.stats.chunkCount);
16584
16585
  var contiguous = !trackSwitch && (snDiff === 1 || snDiff === 0 && (partDiff === 1 || progressive && partDiff <= 0));
16585
16586
  var now = self.performance.now();
16586
16587
  if (trackSwitch || snDiff || frag.stats.parsing.start === 0) {
@@ -16589,7 +16590,7 @@
16589
16590
  if (part && (partDiff || !contiguous)) {
16590
16591
  part.stats.parsing.start = now;
16591
16592
  }
16592
- var initSegmentChange = !(lastFrag && ((_frag$initSegment = frag.initSegment) == null ? void 0 : _frag$initSegment.url) === ((_lastFrag$initSegment = lastFrag.initSegment) == null ? void 0 : _lastFrag$initSegment.url));
16593
+ var initSegmentChange = !(lastFrag && ((_frag$initSegment = frag.initSegment) == null ? undefined : _frag$initSegment.url) === ((_lastFrag$initSegment = lastFrag.initSegment) == null ? undefined : _lastFrag$initSegment.url));
16593
16594
  var state = new TransmuxState(discontinuity, contiguous, accurateTimeOffset, trackSwitch, timeOffset, initSegmentChange);
16594
16595
  if (!contiguous || discontinuity || initSegmentChange) {
16595
16596
  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 + "\n discontinuity: " + discontinuity + "\n trackSwitch: " + trackSwitch + "\n contiguous: " + contiguous + "\n accurateTimeOffset: " + accurateTimeOffset + "\n timeOffset: " + timeOffset + "\n initSegmentChange: " + initSegmentChange);
@@ -16848,8 +16849,8 @@
16848
16849
  {
16849
16850
  var levels = this.levels,
16850
16851
  trackId = this.trackId;
16851
- var currenTrack = levels == null ? void 0 : levels[trackId];
16852
- var details = currenTrack == null ? void 0 : currenTrack.details;
16852
+ var currenTrack = levels == null ? undefined : levels[trackId];
16853
+ var details = currenTrack == null ? undefined : currenTrack.details;
16853
16854
  if (details && !this.waitForLive(currenTrack)) {
16854
16855
  if (this.waitForCdnTuneIn(details)) {
16855
16856
  break;
@@ -16868,7 +16869,7 @@
16868
16869
  var _levels = this.levels,
16869
16870
  _trackId = this.trackId;
16870
16871
  this.log('RetryDate reached, switch back to IDLE state');
16871
- this.resetStartWhenNotLoaded((_levels == null ? void 0 : _levels[_trackId]) || null);
16872
+ this.resetStartWhenNotLoaded((_levels == null ? undefined : _levels[_trackId]) || null);
16872
16873
  this.state = State.IDLE;
16873
16874
  }
16874
16875
  break;
@@ -17015,7 +17016,7 @@
17015
17016
  }
17016
17017
 
17017
17018
  // Request audio segments up to one fragment ahead of main stream-controller
17018
- var mainFragLoading = (_this$mainFragLoading = this.mainFragLoading) == null ? void 0 : _this$mainFragLoading.frag;
17019
+ var mainFragLoading = (_this$mainFragLoading = this.mainFragLoading) == null ? undefined : _this$mainFragLoading.frag;
17019
17020
  if (!this.audioOnly && this.startFragRequested && mainFragLoading && isMediaFragment(mainFragLoading) && isMediaFragment(frag) && !frag.endList && (!trackDetails.live || !this.loadingParts && targetBufferTime < this.hls.liveSyncPosition)) {
17020
17021
  var mainFrag = mainFragLoading;
17021
17022
  if (frag.start > mainFrag.end) {
@@ -17122,7 +17123,7 @@
17122
17123
  }
17123
17124
  if (trackLevel.details) {
17124
17125
  var _this$levelLastLoaded;
17125
- sliding = this.alignPlaylists(newDetails, trackLevel.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ? void 0 : _this$levelLastLoaded.details);
17126
+ sliding = this.alignPlaylists(newDetails, trackLevel.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ? undefined : _this$levelLastLoaded.details);
17126
17127
  }
17127
17128
  if (!newDetails.alignedSliding) {
17128
17129
  // Align audio rendition with the "main" playlist on discontinuity change
@@ -17187,7 +17188,7 @@
17187
17188
  // Check if we have video initPTS
17188
17189
  // If not we need to wait for it
17189
17190
  var initPTS = this.initPTS[frag.cc];
17190
- var initSegmentData = (_frag$initSegment = frag.initSegment) == null ? void 0 : _frag$initSegment.data;
17191
+ var initSegmentData = (_frag$initSegment = frag.initSegment) == null ? undefined : _frag$initSegment.data;
17191
17192
  if (initPTS !== undefined) {
17192
17193
  // this.log(`Transmuxing ${sn} of [${details.startSN} ,${details.endSN}],track ${trackId}`);
17193
17194
  // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)
@@ -17288,7 +17289,7 @@
17288
17289
  case ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:
17289
17290
  case ErrorDetails.LEVEL_PARSING_ERROR:
17290
17291
  // in case of non fatal error while loading track, if not retrying to load track, switch back to IDLE
17291
- if (!data.levelRetry && this.state === State.WAITING_TRACK && ((_data$context = data.context) == null ? void 0 : _data$context.type) === PlaylistContextType.AUDIO_TRACK) {
17292
+ if (!data.levelRetry && this.state === State.WAITING_TRACK && ((_data$context = data.context) == null ? undefined : _data$context.type) === PlaylistContextType.AUDIO_TRACK) {
17292
17293
  this.state = State.IDLE;
17293
17294
  }
17294
17295
  break;
@@ -17471,7 +17472,7 @@
17471
17472
  _proto.flushAudioIfNeeded = function flushAudioIfNeeded(switchingTrack) {
17472
17473
  var media = this.media,
17473
17474
  bufferedTrack = this.bufferedTrack;
17474
- var bufferedAttributes = bufferedTrack == null ? void 0 : bufferedTrack.attrs;
17475
+ var bufferedAttributes = bufferedTrack == null ? undefined : bufferedTrack.attrs;
17475
17476
  var switchAttributes = switchingTrack.attrs;
17476
17477
  if (media && bufferedAttributes && (bufferedAttributes.CHANNELS !== switchAttributes.CHANNELS || bufferedTrack.name !== switchingTrack.name || bufferedTrack.lang !== switchingTrack.lang)) {
17477
17478
  if (useAlternateAudio(switchingTrack.url, this.hls)) {
@@ -17498,7 +17499,7 @@
17498
17499
  function BasePlaylistController(hls, logPrefix) {
17499
17500
  var _this;
17500
17501
  _this = _Logger.call(this, logPrefix, hls.logger) || this;
17501
- _this.hls = void 0;
17502
+ _this.hls = undefined;
17502
17503
  _this.canLoad = false;
17503
17504
  _this.timer = -1;
17504
17505
  _this.hls = hls;
@@ -17526,12 +17527,12 @@
17526
17527
  this.clearTimer();
17527
17528
  };
17528
17529
  _proto.switchParams = function switchParams(playlistUri, previous, current) {
17529
- var renditionReports = previous == null ? void 0 : previous.renditionReports;
17530
+ var renditionReports = previous == null ? undefined : previous.renditionReports;
17530
17531
  if (renditionReports) {
17531
17532
  var foundIndex = -1;
17532
17533
  for (var i = 0; i < renditionReports.length; i++) {
17533
17534
  var attr = renditionReports[i];
17534
- var uri = void 0;
17535
+ var uri = undefined;
17535
17536
  try {
17536
17537
  uri = new self.URL(attr.URI, previous.url).href;
17537
17538
  } catch (error) {
@@ -17549,8 +17550,8 @@
17549
17550
  }
17550
17551
  if (foundIndex !== -1) {
17551
17552
  var _attr = renditionReports[foundIndex];
17552
- var msn = parseInt(_attr['LAST-MSN']) || (previous == null ? void 0 : previous.lastPartSn);
17553
- var part = parseInt(_attr['LAST-PART']) || (previous == null ? void 0 : previous.lastPartIndex);
17553
+ var msn = parseInt(_attr['LAST-MSN']) || (previous == null ? undefined : previous.lastPartSn);
17554
+ var part = parseInt(_attr['LAST-PART']) || (previous == null ? undefined : previous.lastPartIndex);
17554
17555
  if (this.hls.config.lowLatencyMode) {
17555
17556
  var currentGoal = Math.min(previous.age - previous.partTarget, previous.targetduration);
17556
17557
  if (part >= 0 && currentGoal > previous.partTarget) {
@@ -17730,7 +17731,7 @@
17730
17731
  var _ref = errorAction || {},
17731
17732
  action = _ref.action,
17732
17733
  _ref$retryCount = _ref.retryCount,
17733
- retryCount = _ref$retryCount === void 0 ? 0 : _ref$retryCount,
17734
+ retryCount = _ref$retryCount === undefined ? 0 : _ref$retryCount,
17734
17735
  retryConfig = _ref.retryConfig;
17735
17736
  var retry = !!errorAction && !!retryConfig && (action === NetworkErrorAction.RetryRequest || !errorAction.resolved && action === NetworkErrorAction.SendAlternateToPenaltyBox);
17736
17737
  if (retry) {
@@ -17817,7 +17818,7 @@
17817
17818
  details = data.details;
17818
17819
  var trackInActiveGroup = this.tracksInGroup[id];
17819
17820
  if (!trackInActiveGroup || trackInActiveGroup.groupId !== groupId) {
17820
- this.warn("Audio track with id:" + id + " and group:" + groupId + " not found in active group " + (trackInActiveGroup == null ? void 0 : trackInActiveGroup.groupId));
17821
+ this.warn("Audio track with id:" + id + " and group:" + groupId + " not found in active group " + (trackInActiveGroup == null ? undefined : trackInActiveGroup.groupId));
17821
17822
  return;
17822
17823
  }
17823
17824
  var curDetails = trackInActiveGroup.details;
@@ -17841,8 +17842,8 @@
17841
17842
  var audioGroups = levelInfo.audioGroups || null;
17842
17843
  var currentGroups = this.groupIds;
17843
17844
  var currentTrack = this.currentTrack;
17844
- if (!audioGroups || (currentGroups == null ? void 0 : currentGroups.length) !== (audioGroups == null ? void 0 : audioGroups.length) || audioGroups != null && audioGroups.some(function (groupId) {
17845
- return (currentGroups == null ? void 0 : currentGroups.indexOf(groupId)) === -1;
17845
+ if (!audioGroups || (currentGroups == null ? undefined : currentGroups.length) !== (audioGroups == null ? undefined : audioGroups.length) || audioGroups != null && audioGroups.some(function (groupId) {
17846
+ return (currentGroups == null ? undefined : currentGroups.indexOf(groupId)) === -1;
17846
17847
  })) {
17847
17848
  this.groupIds = audioGroups;
17848
17849
  this.trackId = -1;
@@ -17889,14 +17890,14 @@
17889
17890
  var audioTracksUpdated = {
17890
17891
  audioTracks: audioTracks
17891
17892
  };
17892
- this.log("Updating audio tracks, " + audioTracks.length + " track(s) found in group(s): " + (audioGroups == null ? void 0 : audioGroups.join(',')));
17893
+ this.log("Updating audio tracks, " + audioTracks.length + " track(s) found in group(s): " + (audioGroups == null ? undefined : audioGroups.join(',')));
17893
17894
  this.hls.trigger(Events.AUDIO_TRACKS_UPDATED, audioTracksUpdated);
17894
17895
  var selectedTrackId = this.trackId;
17895
17896
  if (trackId !== -1 && selectedTrackId === -1) {
17896
17897
  this.setAudioTrack(trackId);
17897
17898
  } else if (audioTracks.length && selectedTrackId === -1) {
17898
17899
  var _this$groupIds;
17899
- var error = new Error("No audio track selected for current audio group-ID(s): " + ((_this$groupIds = this.groupIds) == null ? void 0 : _this$groupIds.join(',')) + " track count: " + audioTracks.length);
17900
+ var error = new Error("No audio track selected for current audio group-ID(s): " + ((_this$groupIds = this.groupIds) == null ? undefined : _this$groupIds.join(',')) + " track count: " + audioTracks.length);
17900
17901
  this.warn(error.message);
17901
17902
  this.hls.trigger(Events.ERROR, {
17902
17903
  type: ErrorTypes.MEDIA_ERROR,
@@ -17982,7 +17983,7 @@
17982
17983
  if (trackLoaded) {
17983
17984
  return;
17984
17985
  }
17985
- var hlsUrlParameters = this.switchParams(track.url, lastTrack == null ? void 0 : lastTrack.details, track.details);
17986
+ var hlsUrlParameters = this.switchParams(track.url, lastTrack == null ? undefined : lastTrack.details, track.details);
17986
17987
  this.loadPlaylist(hlsUrlParameters);
17987
17988
  };
17988
17989
  _proto.findTrackId = function findTrackId(currentTrack) {
@@ -18048,8 +18049,8 @@
18048
18049
  var groupId = audioTrack.groupId;
18049
18050
  var url = this.getUrlWithDirectives(audioTrack.url, hlsUrlParameters);
18050
18051
  var details = audioTrack.details;
18051
- var age = details == null ? void 0 : details.age;
18052
- this.log("Loading audio-track " + id + " \"" + audioTrack.name + "\" lang:" + audioTrack.lang + " group:" + groupId + ((hlsUrlParameters == null ? void 0 : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : '') + (age && details.live ? ' age ' + age.toFixed(1) + (details.type ? ' ' + details.type || '' : '') : '') + " " + url);
18052
+ var age = details == null ? undefined : details.age;
18053
+ this.log("Loading audio-track " + id + " \"" + audioTrack.name + "\" lang:" + audioTrack.lang + " group:" + groupId + ((hlsUrlParameters == null ? undefined : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : '') + (age && details.live ? ' age ' + age.toFixed(1) + (details.type ? ' ' + details.type || '' : '') : '') + " " + url);
18053
18054
  this.hls.trigger(Events.AUDIO_TRACK_LOADING, {
18054
18055
  url: url,
18055
18056
  id: id,
@@ -18083,7 +18084,7 @@
18083
18084
 
18084
18085
  var BufferOperationQueue = /*#__PURE__*/function () {
18085
18086
  function BufferOperationQueue(sourceBufferReference) {
18086
- this.tracks = void 0;
18087
+ this.tracks = undefined;
18087
18088
  this.queues = {
18088
18089
  video: [],
18089
18090
  audio: [],
@@ -18139,7 +18140,7 @@
18139
18140
  }
18140
18141
  [this.queues.video, this.queues.audio, this.queues.audiovideo].forEach(function (queue) {
18141
18142
  var _queue$;
18142
- var label = (_queue$ = queue[0]) == null ? void 0 : _queue$.label;
18143
+ var label = (_queue$ = queue[0]) == null ? undefined : _queue$.label;
18143
18144
  if (label === 'async-blocker' || label === 'async-blocker-prepend') {
18144
18145
  queue[0].execute();
18145
18146
  queue.splice(0, 1);
@@ -18174,7 +18175,7 @@
18174
18175
  }
18175
18176
 
18176
18177
  // Only shift the current operation off, otherwise the updateend handler will do this for us
18177
- var sb = (_this$tracks$type = this.tracks[type]) == null ? void 0 : _this$tracks$type.buffer;
18178
+ var sb = (_this$tracks$type = this.tracks[type]) == null ? undefined : _this$tracks$type.buffer;
18178
18179
  if (!(sb != null && sb.updating)) {
18179
18180
  this.shiftAndExecuteNext(type);
18180
18181
  }
@@ -18190,7 +18191,7 @@
18190
18191
  };
18191
18192
  _proto.current = function current(type) {
18192
18193
  var _this$queues;
18193
- return ((_this$queues = this.queues) == null ? void 0 : _this$queues[type][0]) || null;
18194
+ return ((_this$queues = this.queues) == null ? undefined : _this$queues[type][0]) || null;
18194
18195
  };
18195
18196
  _proto.toString = function toString() {
18196
18197
  var queues = this.queues,
@@ -18206,8 +18207,8 @@
18206
18207
  };
18207
18208
  _proto.listSbInfo = function listSbInfo(type) {
18208
18209
  var _this$tracks2;
18209
- var track = (_this$tracks2 = this.tracks) == null ? void 0 : _this$tracks2[type];
18210
- var sb = track == null ? void 0 : track.buffer;
18210
+ var track = (_this$tracks2 = this.tracks) == null ? undefined : _this$tracks2[type];
18211
+ var sb = track == null ? undefined : track.buffer;
18211
18212
  if (!sb) {
18212
18213
  return 'none';
18213
18214
  }
@@ -18215,7 +18216,7 @@
18215
18216
  };
18216
18217
  _proto.listOps = function listOps(type) {
18217
18218
  var _this$queues3;
18218
- return ((_this$queues3 = this.queues) == null ? void 0 : _this$queues3[type].map(function (op) {
18219
+ return ((_this$queues3 = this.queues) == null ? undefined : _this$queues3[type].map(function (op) {
18219
18220
  return op.label;
18220
18221
  }).join(', ')) || '';
18221
18222
  };
@@ -18238,8 +18239,8 @@
18238
18239
  function BufferController(hls, fragmentTracker) {
18239
18240
  var _this2;
18240
18241
  _this2 = _Logger.call(this, 'buffer-controller', hls.logger) || this;
18241
- _this2.hls = void 0;
18242
- _this2.fragmentTracker = void 0;
18242
+ _this2.hls = undefined;
18243
+ _this2.fragmentTracker = undefined;
18243
18244
  // The level details used to determine duration, target-duration and live
18244
18245
  _this2.details = null;
18245
18246
  // cache the self generated object url to detect hijack of video tag
@@ -18259,11 +18260,11 @@
18259
18260
  // Keep track of video append position for unblocking audio
18260
18261
  _this2.lastVideoAppendEnd = 0;
18261
18262
  // Whether or not to use ManagedMediaSource API and append source element to media element.
18262
- _this2.appendSource = void 0;
18263
+ _this2.appendSource = undefined;
18263
18264
  // Transferred MediaSource information used to detmerine if duration end endstream may be appended
18264
- _this2.transferData = void 0;
18265
+ _this2.transferData = undefined;
18265
18266
  // Directives used to override default MediaSource handling
18266
- _this2.overrides = void 0;
18267
+ _this2.overrides = undefined;
18267
18268
  // Error counters
18268
18269
  _this2.appendErrors = {
18269
18270
  audio: 0,
@@ -18279,7 +18280,7 @@
18279
18280
  if (!_this2.hls) {
18280
18281
  return;
18281
18282
  }
18282
- if (((_this2$mediaSource = _this2.mediaSource) == null ? void 0 : _this2$mediaSource.readyState) !== 'open') {
18283
+ if (((_this2$mediaSource = _this2.mediaSource) == null ? undefined : _this2$mediaSource.readyState) !== 'open') {
18283
18284
  return;
18284
18285
  }
18285
18286
  _this2.hls.pauseBuffering();
@@ -18448,7 +18449,7 @@
18448
18449
  // in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller
18449
18450
  // it will contain the expected nb of source buffers, no need to compute it
18450
18451
  var codecEvents = 2;
18451
- if (data.audio && !data.video || !data.altAudio || !true) {
18452
+ if (data.audio && !data.video || !data.altAudio || false) {
18452
18453
  codecEvents = 1;
18453
18454
  }
18454
18455
  this.bufferCodecEventsTotal = codecEvents;
@@ -18497,7 +18498,7 @@
18497
18498
  };
18498
18499
  _proto.assignMediaSource = function assignMediaSource(ms) {
18499
18500
  var _this$transferData2, _ms$constructor;
18500
- 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));
18501
+ 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));
18501
18502
  // MediaSource listeners are arrow functions with a lexical scope, and do not need to be bound
18502
18503
  ms.addEventListener('sourceopen', this._onMediaSourceOpen);
18503
18504
  ms.addEventListener('sourceended', this._onMediaSourceEnded);
@@ -18541,7 +18542,7 @@
18541
18542
  data.tracks = undefined;
18542
18543
  var currentTime = media.currentTime;
18543
18544
  var details = this.details;
18544
- var startTime = Math.max(currentTime, (details == null ? void 0 : details.fragments[0].start) || 0);
18545
+ var startTime = Math.max(currentTime, (details == null ? undefined : details.fragments[0].start) || 0);
18545
18546
  if (startTime - currentTime > 1) {
18546
18547
  this.log("attachTransferred: waiting for playback to reach new tracks start time " + currentTime + " -> " + startTime);
18547
18548
  return;
@@ -18678,7 +18679,7 @@
18678
18679
  };
18679
18680
  _proto.resetBuffer = function resetBuffer(type) {
18680
18681
  var _this$tracks$type;
18681
- var sb = (_this$tracks$type = this.tracks[type]) == null ? void 0 : _this$tracks$type.buffer;
18682
+ var sb = (_this$tracks$type = this.tracks[type]) == null ? undefined : _this$tracks$type.buffer;
18682
18683
  this.removeBuffer(type);
18683
18684
  if (sb) {
18684
18685
  try {
@@ -18731,10 +18732,10 @@
18731
18732
  container = parsedTrack.container,
18732
18733
  metadata = parsedTrack.metadata;
18733
18734
  var track = tracks[trackName];
18734
- var transferredTrack = (_this9$transferData = _this9.transferData) == null ? void 0 : (_this9$transferData$t = _this9$transferData.tracks) == null ? void 0 : _this9$transferData$t[trackName];
18735
+ var transferredTrack = (_this9$transferData = _this9.transferData) == null ? undefined : (_this9$transferData$t = _this9$transferData.tracks) == null ? undefined : _this9$transferData$t[trackName];
18735
18736
  var sbTrack = transferredTrack != null && transferredTrack.buffer ? transferredTrack : track;
18736
- var sbCodec = (sbTrack == null ? void 0 : sbTrack.pendingCodec) || (sbTrack == null ? void 0 : sbTrack.codec);
18737
- var trackLevelCodec = sbTrack == null ? void 0 : sbTrack.levelCodec;
18737
+ var sbCodec = (sbTrack == null ? undefined : sbTrack.pendingCodec) || (sbTrack == null ? undefined : sbTrack.codec);
18738
+ var trackLevelCodec = sbTrack == null ? undefined : sbTrack.levelCodec;
18738
18739
  var forceChangeType = !sbTrack || !!_this9.hls.config.assetPlayerId;
18739
18740
  if (!track) {
18740
18741
  track = tracks[trackName] = {
@@ -18749,9 +18750,9 @@
18749
18750
  }
18750
18751
  // check if SourceBuffer codec needs to change
18751
18752
  var currentCodecFull = pickMostCompleteCodecName(sbCodec, trackLevelCodec);
18752
- var currentCodec = currentCodecFull == null ? void 0 : currentCodecFull.replace(VIDEO_CODEC_PROFILE_REPLACE, '$1');
18753
+ var currentCodec = currentCodecFull == null ? undefined : currentCodecFull.replace(VIDEO_CODEC_PROFILE_REPLACE, '$1');
18753
18754
  var trackCodec = pickMostCompleteCodecName(codec, levelCodec);
18754
- var nextCodec = (_trackCodec = trackCodec) == null ? void 0 : _trackCodec.replace(VIDEO_CODEC_PROFILE_REPLACE, '$1');
18755
+ var nextCodec = (_trackCodec = trackCodec) == null ? undefined : _trackCodec.replace(VIDEO_CODEC_PROFILE_REPLACE, '$1');
18755
18756
  if (trackCodec && (currentCodec !== nextCodec || forceChangeType)) {
18756
18757
  if (trackName.slice(0, 5) === 'audio') {
18757
18758
  trackCodec = getCodecCompatibleName(trackCodec, _this9.appendSource);
@@ -18807,7 +18808,7 @@
18807
18808
  _this11 = this;
18808
18809
  var pStart = partOrFrag.start;
18809
18810
  var pTime = pStart + partOrFrag.duration * 0.05;
18810
- var atGap = ((_this$fragmentTracker = this.fragmentTracker.getAppendedFrag(pStart, PlaylistLevelType.MAIN)) == null ? void 0 : _this$fragmentTracker.gap) === true;
18811
+ var atGap = ((_this$fragmentTracker = this.fragmentTracker.getAppendedFrag(pStart, PlaylistLevelType.MAIN)) == null ? undefined : _this$fragmentTracker.gap) === true;
18811
18812
  if (atGap) {
18812
18813
  return;
18813
18814
  }
@@ -18816,7 +18817,7 @@
18816
18817
  execute: function execute() {
18817
18818
  var _this11$fragmentTrack;
18818
18819
  var videoTrack = _this11.tracks.video;
18819
- if (_this11.lastVideoAppendEnd > pTime || videoTrack != null && videoTrack.buffer && BufferHelper.isBuffered(videoTrack.buffer, pTime) || ((_this11$fragmentTrack = _this11.fragmentTracker.getAppendedFrag(pTime, PlaylistLevelType.MAIN)) == null ? void 0 : _this11$fragmentTrack.gap) === true) {
18820
+ if (_this11.lastVideoAppendEnd > pTime || videoTrack != null && videoTrack.buffer && BufferHelper.isBuffered(videoTrack.buffer, pTime) || ((_this11$fragmentTrack = _this11.fragmentTracker.getAppendedFrag(pTime, PlaylistLevelType.MAIN)) == null ? undefined : _this11$fragmentTrack.gap) === true) {
18820
18821
  _this11.blockedAudioAppend = null;
18821
18822
  _this11.shiftAndExecuteNext('audio');
18822
18823
  }
@@ -18870,14 +18871,14 @@
18870
18871
  // More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486
18871
18872
  var audioTrack = tracks.audio;
18872
18873
  var checkTimestampOffset = false;
18873
- if (type === 'audio' && (audioTrack == null ? void 0 : audioTrack.container) === 'audio/mpeg') {
18874
+ if (type === 'audio' && (audioTrack == null ? undefined : audioTrack.container) === 'audio/mpeg') {
18874
18875
  checkTimestampOffset = !this.lastMpegAudioChunk || chunkMeta.id === 1 || this.lastMpegAudioChunk.sn !== chunkMeta.sn;
18875
18876
  this.lastMpegAudioChunk = chunkMeta;
18876
18877
  }
18877
18878
 
18878
18879
  // Block audio append until overlapping video append
18879
18880
  var videoTrack = this.tracks.video;
18880
- var videoSb = videoTrack == null ? void 0 : videoTrack.buffer;
18881
+ var videoSb = videoTrack == null ? undefined : videoTrack.buffer;
18881
18882
  if (videoSb && sn !== 'initSegment') {
18882
18883
  var partOrFrag = part || frag;
18883
18884
  var blockedAudioAppend = this.blockedAudioAppend;
@@ -19099,7 +19100,7 @@
19099
19100
  }
19100
19101
  }
19101
19102
  });
19102
- var allowEndOfStream = ((_this$overrides = this.overrides) == null ? void 0 : _this$overrides.endOfStream) !== false;
19103
+ var allowEndOfStream = ((_this$overrides = this.overrides) == null ? undefined : _this$overrides.endOfStream) !== false;
19103
19104
  var allTracksEnding = this.sourceBufferCount > 0 && !this.sourceBuffers.some(function (_ref6) {
19104
19105
  var _this16$tracks$type;
19105
19106
  var type = _ref6[0];
@@ -19154,7 +19155,7 @@
19154
19155
  _proto.onError = function onError(event, data) {
19155
19156
  if (data.details === ErrorDetails.BUFFER_APPEND_ERROR && data.frag) {
19156
19157
  var _data$errorAction;
19157
- var nextAutoLevel = (_data$errorAction = data.errorAction) == null ? void 0 : _data$errorAction.nextAutoLevel;
19158
+ var nextAutoLevel = (_data$errorAction = data.errorAction) == null ? undefined : _data$errorAction.nextAutoLevel;
19158
19159
  if (isFiniteNumber(nextAutoLevel) && nextAutoLevel !== data.frag.level) {
19159
19160
  this.resetAppendErrors();
19160
19161
  }
@@ -19264,7 +19265,7 @@
19264
19265
  var _this$overrides2;
19265
19266
  var details = this.details,
19266
19267
  mediaSource = this.mediaSource;
19267
- if (!details || !this.media || (mediaSource == null ? void 0 : mediaSource.readyState) !== 'open') {
19268
+ if (!details || !this.media || (mediaSource == null ? undefined : mediaSource.readyState) !== 'open') {
19268
19269
  return null;
19269
19270
  }
19270
19271
  var playlistEnd = details.edge;
@@ -19285,7 +19286,7 @@
19285
19286
  duration: Infinity
19286
19287
  };
19287
19288
  }
19288
- var overrideDuration = (_this$overrides2 = this.overrides) == null ? void 0 : _this$overrides2.duration;
19289
+ var overrideDuration = (_this$overrides2 = this.overrides) == null ? undefined : _this$overrides2.duration;
19289
19290
  if (overrideDuration) {
19290
19291
  return {
19291
19292
  duration: overrideDuration
@@ -19330,7 +19331,7 @@
19330
19331
  // 2 tracks is the max (one for audio, one for video). If we've reach this max go ahead and create the buffers.
19331
19332
  if (this.tracksReady) {
19332
19333
  var _this$transferData3;
19333
- var transferredTracks = (_this$transferData3 = this.transferData) == null ? void 0 : _this$transferData3.tracks;
19334
+ var transferredTracks = (_this$transferData3 = this.transferData) == null ? undefined : _this$transferData3.tracks;
19334
19335
  if (transferredTracks && Object.keys(transferredTracks).length) {
19335
19336
  this.attachTransferred();
19336
19337
  } else {
@@ -19466,7 +19467,7 @@
19466
19467
  };
19467
19468
  _proto.onSBUpdateEnd = function onSBUpdateEnd(type) {
19468
19469
  var _this$mediaSource2;
19469
- if (((_this$mediaSource2 = this.mediaSource) == null ? void 0 : _this$mediaSource2.readyState) === 'closed') {
19470
+ if (((_this$mediaSource2 = this.mediaSource) == null ? undefined : _this$mediaSource2.readyState) === 'closed') {
19470
19471
  this.resetBuffer(type);
19471
19472
  return;
19472
19473
  }
@@ -19479,7 +19480,7 @@
19479
19480
  };
19480
19481
  _proto.onSBUpdateError = function onSBUpdateError(type, event) {
19481
19482
  var _this$mediaSource3;
19482
- var error = new Error(type + " SourceBuffer error. MediaSource readyState: " + ((_this$mediaSource3 = this.mediaSource) == null ? void 0 : _this$mediaSource3.readyState));
19483
+ var error = new Error(type + " SourceBuffer error. MediaSource readyState: " + ((_this$mediaSource3 = this.mediaSource) == null ? undefined : _this$mediaSource3.readyState));
19483
19484
  this.error("" + error, event);
19484
19485
  // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error
19485
19486
  // SourceBuffer errors are not necessarily fatal; if so, the HTMLMediaElement will fire an error event
@@ -19503,7 +19504,7 @@
19503
19504
  var media = this.media,
19504
19505
  mediaSource = this.mediaSource;
19505
19506
  var track = this.tracks[type];
19506
- var sb = track == null ? void 0 : track.buffer;
19507
+ var sb = track == null ? undefined : track.buffer;
19507
19508
  if (!media || !mediaSource || !sb) {
19508
19509
  this.warn("Attempting to remove from the " + type + " SourceBuffer, but it does not exist");
19509
19510
  this.shiftAndExecuteNext(type);
@@ -19527,7 +19528,7 @@
19527
19528
  ;
19528
19529
  _proto.appendExecutor = function appendExecutor(data, type) {
19529
19530
  var track = this.tracks[type];
19530
- var sb = track == null ? void 0 : track.buffer;
19531
+ var sb = track == null ? undefined : track.buffer;
19531
19532
  if (!sb) {
19532
19533
  throw new HlsJsTrackRemovedError("Attempting to append to the " + type + " SourceBuffer, but it does not exist");
19533
19534
  }
@@ -19566,7 +19567,7 @@
19566
19567
  ;
19567
19568
  _proto.blockBuffers = function blockBuffers(onUnblocked, bufferNames) {
19568
19569
  var _this23 = this;
19569
- if (bufferNames === void 0) {
19570
+ if (bufferNames === undefined) {
19570
19571
  bufferNames = this.sourceBufferTypes;
19571
19572
  }
19572
19573
  if (!bufferNames.length) {
@@ -19597,7 +19598,7 @@
19597
19598
  var _this24 = this;
19598
19599
  bufferNames.forEach(function (type) {
19599
19600
  var _this24$tracks$type;
19600
- var sb = (_this24$tracks$type = _this24.tracks[type]) == null ? void 0 : _this24$tracks$type.buffer;
19601
+ var sb = (_this24$tracks$type = _this24.tracks[type]) == null ? undefined : _this24$tracks$type.buffer;
19601
19602
  // Only cycle the queue if the SB is not updating. There's a bug in Chrome which sets the SB updating flag to
19602
19603
  // true when changing the MediaSource duration (https://bugs.chromium.org/p/chromium/issues/detail?id=959359&can=2&q=mediasource%20duration)
19603
19604
  // While this is a workaround, it's probably useful to have around
@@ -19667,7 +19668,7 @@
19667
19668
  key: "mediaSourceOpenOrEnded",
19668
19669
  get: function get() {
19669
19670
  var _this$mediaSource4;
19670
- var readyState = (_this$mediaSource4 = this.mediaSource) == null ? void 0 : _this$mediaSource4.readyState;
19671
+ var readyState = (_this$mediaSource4 = this.mediaSource) == null ? undefined : _this$mediaSource4.readyState;
19671
19672
  return readyState === 'open' || readyState === 'ended';
19672
19673
  }
19673
19674
  }, {
@@ -19692,7 +19693,7 @@
19692
19693
  return this.sourceBufferCount > 0 && !this.sourceBuffers.some(function (_ref16) {
19693
19694
  var _this26$tracks$type, _this26$tracks$type2;
19694
19695
  var type = _ref16[0];
19695
- return type && (!((_this26$tracks$type = _this26.tracks[type]) != null && _this26$tracks$type.ended) || ((_this26$tracks$type2 = _this26.tracks[type]) == null ? void 0 : _this26$tracks$type2.ending));
19696
+ return type && (!((_this26$tracks$type = _this26.tracks[type]) != null && _this26$tracks$type.ended) || ((_this26$tracks$type2 = _this26.tracks[type]) == null ? undefined : _this26$tracks$type2.ending));
19696
19697
  });
19697
19698
  }
19698
19699
  }, {
@@ -19705,8 +19706,8 @@
19705
19706
  key: "mediaSrc",
19706
19707
  get: function get() {
19707
19708
  var _this$media, _this$media$querySele;
19708
- var media = ((_this$media = this.media) == null ? void 0 : (_this$media$querySele = _this$media.querySelector) == null ? void 0 : _this$media$querySele.call(_this$media, 'source')) || this.media;
19709
- return media == null ? void 0 : media.src;
19709
+ var media = ((_this$media = this.media) == null ? undefined : (_this$media$querySele = _this$media.querySelector) == null ? undefined : _this$media$querySele.call(_this$media, 'source')) || this.media;
19710
+ return media == null ? undefined : media.src;
19710
19711
  }
19711
19712
  }, {
19712
19713
  key: "pendingTrackCount",
@@ -19754,14 +19755,14 @@
19754
19755
 
19755
19756
  var CapLevelController = /*#__PURE__*/function () {
19756
19757
  function CapLevelController(hls) {
19757
- this.hls = void 0;
19758
- this.autoLevelCapping = void 0;
19759
- this.firstLevel = void 0;
19760
- this.media = void 0;
19761
- this.restrictedLevels = void 0;
19762
- this.timer = void 0;
19763
- this.clientRect = void 0;
19764
- this.streamController = void 0;
19758
+ this.hls = undefined;
19759
+ this.autoLevelCapping = undefined;
19760
+ this.firstLevel = undefined;
19761
+ this.media = undefined;
19762
+ this.restrictedLevels = undefined;
19763
+ this.timer = undefined;
19764
+ this.clientRect = undefined;
19765
+ this.streamController = undefined;
19765
19766
  this.hls = hls;
19766
19767
  this.autoLevelCapping = Number.POSITIVE_INFINITY;
19767
19768
  this.firstLevel = -1;
@@ -20630,7 +20631,7 @@
20630
20631
  //
20631
20632
  // 3. Return output.
20632
20633
  function serializeDict(dict, options) {
20633
- if (options === void 0) {
20634
+ if (options === undefined) {
20634
20635
  options = {
20635
20636
  whitespace: true
20636
20637
  };
@@ -20639,7 +20640,7 @@
20639
20640
  throw serializeError(dict, DICT);
20640
20641
  }
20641
20642
  var entries = dict instanceof Map ? dict.entries() : Object.entries(dict);
20642
- var optionalWhiteSpace = (options === null || options === void 0 ? void 0 : options.whitespace) ? ' ' : '';
20643
+ var optionalWhiteSpace = (options === null || options === undefined ? undefined : options.whitespace) ? ' ' : '';
20643
20644
  return Array.from(entries).map(function (_ref) {
20644
20645
  var key = _ref[0],
20645
20646
  item = _ref[1];
@@ -20710,7 +20711,7 @@
20710
20711
  return Math.round(value);
20711
20712
  };
20712
20713
  var toUrlSafe = function toUrlSafe(value, options) {
20713
- if (options === null || options === void 0 ? void 0 : options.baseUrl) {
20714
+ if (options === null || options === undefined ? undefined : options.baseUrl) {
20714
20715
  value = urlToRelativePath(value, options.baseUrl);
20715
20716
  }
20716
20717
  return encodeURIComponent(value);
@@ -20777,10 +20778,10 @@
20777
20778
  return results;
20778
20779
  }
20779
20780
  var keys = Object.keys(obj).sort();
20780
- var formatters = _extends({}, CmcdFormatters, options === null || options === void 0 ? void 0 : options.formatters);
20781
- var filter = options === null || options === void 0 ? void 0 : options.filter;
20781
+ var formatters = _extends({}, CmcdFormatters, options === null || options === undefined ? undefined : options.formatters);
20782
+ var filter = options === null || options === undefined ? undefined : options.filter;
20782
20783
  keys.forEach(function (key) {
20783
- if (filter === null || filter === void 0 ? void 0 : filter(key)) {
20784
+ if (filter === null || filter === undefined ? undefined : filter(key)) {
20784
20785
  return;
20785
20786
  }
20786
20787
  var value = obj[key];
@@ -20821,7 +20822,7 @@
20821
20822
  * @beta
20822
20823
  */
20823
20824
  function encodeCmcd(cmcd, options) {
20824
- if (options === void 0) {
20825
+ if (options === undefined) {
20825
20826
  options = {};
20826
20827
  }
20827
20828
  if (!cmcd) {
@@ -20845,7 +20846,7 @@
20845
20846
  * @beta
20846
20847
  */
20847
20848
  function toCmcdHeaders(cmcd, options) {
20848
- if (options === void 0) {
20849
+ if (options === undefined) {
20849
20850
  options = {};
20850
20851
  }
20851
20852
  var result = {};
@@ -20853,15 +20854,15 @@
20853
20854
  return result;
20854
20855
  }
20855
20856
  var entries = Object.entries(cmcd);
20856
- var headerMap = Object.entries(CmcdHeaderMap).concat(Object.entries((options === null || options === void 0 ? void 0 : options.customHeaderMap) || {}));
20857
+ var headerMap = Object.entries(CmcdHeaderMap).concat(Object.entries((options === null || options === undefined ? undefined : options.customHeaderMap) || {}));
20857
20858
  var shards = entries.reduce(function (acc, entry) {
20858
20859
  var _a, _b;
20859
20860
  var key = entry[0],
20860
20861
  value = entry[1];
20861
20862
  var field = ((_a = headerMap.find(function (entry) {
20862
20863
  return entry[1].includes(key);
20863
- })) === null || _a === void 0 ? void 0 : _a[0]) || CmcdHeaderField.REQUEST;
20864
- (_b = acc[field]) !== null && _b !== void 0 ? _b : acc[field] = {};
20864
+ })) === null || _a === undefined ? undefined : _a[0]) || CmcdHeaderField.REQUEST;
20865
+ (_b = acc[field]) !== null && _b !== undefined ? _b : acc[field] = {};
20865
20866
  acc[field][key] = value;
20866
20867
  return acc;
20867
20868
  }, {});
@@ -20912,7 +20913,7 @@
20912
20913
  * @beta
20913
20914
  */
20914
20915
  function toCmcdQuery(cmcd, options) {
20915
- if (options === void 0) {
20916
+ if (options === undefined) {
20916
20917
  options = {};
20917
20918
  }
20918
20919
  if (!cmcd) {
@@ -20957,18 +20958,18 @@
20957
20958
  var CMCDController = /*#__PURE__*/function () {
20958
20959
  function CMCDController(hls) {
20959
20960
  var _this = this;
20960
- this.hls = void 0;
20961
- this.config = void 0;
20962
- this.media = void 0;
20963
- this.sid = void 0;
20964
- this.cid = void 0;
20961
+ this.hls = undefined;
20962
+ this.config = undefined;
20963
+ this.media = undefined;
20964
+ this.sid = undefined;
20965
+ this.cid = undefined;
20965
20966
  this.useHeaders = false;
20966
- this.includeKeys = void 0;
20967
+ this.includeKeys = undefined;
20967
20968
  this.initialized = false;
20968
20969
  this.starved = false;
20969
20970
  this.buffering = true;
20970
- this.audioBuffer = void 0;
20971
- this.videoBuffer = void 0;
20971
+ this.audioBuffer = undefined;
20972
+ this.videoBuffer = undefined;
20972
20973
  this.onWaiting = function () {
20973
20974
  if (_this.initialized) {
20974
20975
  _this.starved = true;
@@ -21073,8 +21074,8 @@
21073
21074
  };
21074
21075
  _proto.onBufferCreated = function onBufferCreated(event, data) {
21075
21076
  var _data$tracks$audio, _data$tracks$video;
21076
- this.audioBuffer = (_data$tracks$audio = data.tracks.audio) == null ? void 0 : _data$tracks$audio.buffer;
21077
- this.videoBuffer = (_data$tracks$video = data.tracks.video) == null ? void 0 : _data$tracks$video.buffer;
21077
+ this.audioBuffer = (_data$tracks$audio = data.tracks.audio) == null ? undefined : _data$tracks$audio.buffer;
21078
+ this.videoBuffer = (_data$tracks$video = data.tracks.video) == null ? undefined : _data$tracks$video.buffer;
21078
21079
  };
21079
21080
  /**
21080
21081
  * Create baseline CMCD data
@@ -21086,7 +21087,7 @@
21086
21087
  sf: CmcdStreamingFormat.HLS,
21087
21088
  sid: this.sid,
21088
21089
  cid: this.cid,
21089
- pr: (_this$media = this.media) == null ? void 0 : _this$media.playbackRate,
21090
+ pr: (_this$media = this.media) == null ? undefined : _this$media.playbackRate,
21090
21091
  mtp: this.hls.bandwidthEstimate / 1000
21091
21092
  };
21092
21093
  }
@@ -21095,7 +21096,7 @@
21095
21096
  * Apply CMCD data to a request.
21096
21097
  */;
21097
21098
  _proto.apply = function apply(context, data) {
21098
- if (data === void 0) {
21099
+ if (data === undefined) {
21099
21100
  data = {};
21100
21101
  }
21101
21102
  // apply baseline data
@@ -21133,7 +21134,7 @@
21133
21134
  };
21134
21135
  _proto.getNextFrag = function getNextFrag(fragment) {
21135
21136
  var _this$hls$levels$frag;
21136
- var levelDetails = (_this$hls$levels$frag = this.hls.levels[fragment.level]) == null ? void 0 : _this$hls$levels$frag.details;
21137
+ var levelDetails = (_this$hls$levels$frag = this.hls.levels[fragment.level]) == null ? undefined : _this$hls$levels$frag.details;
21137
21138
  if (levelDetails) {
21138
21139
  var index = fragment.sn - levelDetails.startSN;
21139
21140
  return levelDetails.fragments[index + 1];
@@ -21144,7 +21145,7 @@
21144
21145
  var _this$hls$levels$frag2, _this$hls$levels$frag3;
21145
21146
  var index = part.index,
21146
21147
  fragment = part.fragment;
21147
- var partList = (_this$hls$levels$frag2 = this.hls.levels[fragment.level]) == null ? void 0 : (_this$hls$levels$frag3 = _this$hls$levels$frag2.details) == null ? void 0 : _this$hls$levels$frag3.partList;
21148
+ var partList = (_this$hls$levels$frag2 = this.hls.levels[fragment.level]) == null ? undefined : (_this$hls$levels$frag3 = _this$hls$levels$frag2.details) == null ? undefined : _this$hls$levels$frag3.partList;
21148
21149
  if (partList) {
21149
21150
  var sn = fragment.sn;
21150
21151
  for (var i = partList.length - 1; i >= 0; i--) {
@@ -21225,7 +21226,7 @@
21225
21226
  var Ctor = pLoader || this.config.loader;
21226
21227
  return /*#__PURE__*/function () {
21227
21228
  function CmcdPlaylistLoader(config) {
21228
- this.loader = void 0;
21229
+ this.loader = undefined;
21229
21230
  this.loader = new Ctor(config);
21230
21231
  }
21231
21232
  var _proto2 = CmcdPlaylistLoader.prototype;
@@ -21262,7 +21263,7 @@
21262
21263
  var Ctor = fLoader || this.config.loader;
21263
21264
  return /*#__PURE__*/function () {
21264
21265
  function CmcdFragmentLoader(config) {
21265
- this.loader = void 0;
21266
+ this.loader = undefined;
21266
21267
  this.loader = new Ctor(config);
21267
21268
  }
21268
21269
  var _proto3 = CmcdFragmentLoader.prototype;
@@ -21297,7 +21298,7 @@
21297
21298
  function ContentSteeringController(hls) {
21298
21299
  var _this;
21299
21300
  _this = _Logger.call(this, 'content-steering', hls.logger) || this;
21300
- _this.hls = void 0;
21301
+ _this.hls = undefined;
21301
21302
  _this.loader = null;
21302
21303
  _this.uri = null;
21303
21304
  _this.pathwayId = '.';
@@ -21411,7 +21412,7 @@
21411
21412
  };
21412
21413
  _proto.onError = function onError(event, data) {
21413
21414
  var errorAction = data.errorAction;
21414
- if ((errorAction == null ? void 0 : errorAction.action) === NetworkErrorAction.SendAlternateToPenaltyBox && errorAction.flags === ErrorActionFlags.MoveAllAlternatesMatchingHost) {
21415
+ if ((errorAction == null ? undefined : errorAction.action) === NetworkErrorAction.SendAlternateToPenaltyBox && errorAction.flags === ErrorActionFlags.MoveAllAlternatesMatchingHost) {
21415
21416
  var levels = this.levels;
21416
21417
  var pathwayPriority = this._pathwayPriority;
21417
21418
  var errorPathway = this.pathwayId;
@@ -21612,7 +21613,7 @@
21612
21613
  onSuccess: function onSuccess(response, stats, context, networkDetails) {
21613
21614
  _this3.log("Loaded steering manifest: \"" + url + "\"");
21614
21615
  var steeringData = response.data;
21615
- if ((steeringData == null ? void 0 : steeringData.VERSION) !== 1) {
21616
+ if ((steeringData == null ? undefined : steeringData.VERSION) !== 1) {
21616
21617
  _this3.log("Steering VERSION " + steeringData.VERSION + " not supported!");
21617
21618
  return;
21618
21619
  }
@@ -21654,7 +21655,7 @@
21654
21655
  var ttl = _this3.timeToLoad * 1000;
21655
21656
  if (error.code === 429) {
21656
21657
  var loader = _this3.loader;
21657
- if (typeof (loader == null ? void 0 : loader.getResponseHeader) === 'function') {
21658
+ if (typeof (loader == null ? undefined : loader.getResponseHeader) === 'function') {
21658
21659
  var retryAfter = loader.getResponseHeader('Retry-After');
21659
21660
  if (retryAfter) {
21660
21661
  ttl = parseFloat(retryAfter) * 1000;
@@ -21675,13 +21676,13 @@
21675
21676
  };
21676
21677
  _proto.scheduleRefresh = function scheduleRefresh(uri, ttlMs) {
21677
21678
  var _this4 = this;
21678
- if (ttlMs === void 0) {
21679
+ if (ttlMs === undefined) {
21679
21680
  ttlMs = this.timeToLoad * 1000;
21680
21681
  }
21681
21682
  this.clearTimeout();
21682
21683
  this.reloadTimer = self.setTimeout(function () {
21683
21684
  var _this4$hls;
21684
- var media = (_this4$hls = _this4.hls) == null ? void 0 : _this4$hls.media;
21685
+ var media = (_this4$hls = _this4.hls) == null ? undefined : _this4$hls.media;
21685
21686
  if (media && !media.ended) {
21686
21687
  _this4.loadSteeringManifest(uri);
21687
21688
  return;
@@ -21724,7 +21725,7 @@
21724
21725
  perOptionUris = uriReplacement[perOptionKey];
21725
21726
  var perVariantUri;
21726
21727
  if (stableId) {
21727
- perVariantUri = perOptionUris == null ? void 0 : perOptionUris[stableId];
21728
+ perVariantUri = perOptionUris == null ? undefined : perOptionUris[stableId];
21728
21729
  if (perVariantUri) {
21729
21730
  uri = perVariantUri;
21730
21731
  }
@@ -21754,8 +21755,8 @@
21754
21755
  function EMEController(hls) {
21755
21756
  var _this;
21756
21757
  _this = _Logger.call(this, 'eme', hls.logger) || this;
21757
- _this.hls = void 0;
21758
- _this.config = void 0;
21758
+ _this.hls = undefined;
21759
+ _this.config = undefined;
21759
21760
  _this.media = null;
21760
21761
  _this.keyFormatPromise = null;
21761
21762
  _this.keySystemAccessPromises = {};
@@ -22033,7 +22034,7 @@
22033
22034
  // This can throw, but is caught in event handler callpath
22034
22035
  var mediaKeySystemConfigs = getSupportedMediaKeySystemConfigurations(keySystem, audioCodecs, videoCodecs, this.config.drmSystemOptions);
22035
22036
  var keySystemAccessPromises = this.keySystemAccessPromises[keySystem];
22036
- var keySystemAccess = keySystemAccessPromises == null ? void 0 : keySystemAccessPromises.keySystemAccess;
22037
+ var keySystemAccess = keySystemAccessPromises == null ? undefined : keySystemAccessPromises.keySystemAccess;
22037
22038
  if (!keySystemAccess) {
22038
22039
  this.log("Requesting encrypted media \"" + keySystem + "\" key-system access with config: " + JSON.stringify(mediaKeySystemConfigs));
22039
22040
  keySystemAccess = this.requestMediaKeySystemAccess(keySystem, mediaKeySystemConfigs);
@@ -22106,7 +22107,7 @@
22106
22107
  _proto.updateKeySession = function updateKeySession(mediaKeySessionContext, data) {
22107
22108
  var _mediaKeySessionConte;
22108
22109
  var keySession = mediaKeySessionContext.mediaKeysSession;
22109
- this.log("Updating key-session \"" + keySession.sessionId + "\" for keyID " + Hex.hexDump(((_mediaKeySessionConte = mediaKeySessionContext.decryptdata) == null ? void 0 : _mediaKeySessionConte.keyId) || []) + "\n } (data length: " + (data ? data.byteLength : data) + ")");
22110
+ this.log("Updating key-session \"" + keySession.sessionId + "\" for keyID " + Hex.hexDump(((_mediaKeySessionConte = mediaKeySessionContext.decryptdata) == null ? undefined : _mediaKeySessionConte.keyId) || []) + "\n } (data length: " + (data ? data.byteLength : data) + ")");
22110
22111
  return keySession.update(data);
22111
22112
  };
22112
22113
  _proto.selectKeySystemFormat = function selectKeySystemFormat(frag) {
@@ -22239,7 +22240,7 @@
22239
22240
  var _this$config$drmSyste,
22240
22241
  _this$config$drmSyste2,
22241
22242
  _this8 = this;
22242
- var generateRequestFilter = (_this$config$drmSyste = this.config.drmSystems) == null ? void 0 : (_this$config$drmSyste2 = _this$config$drmSyste[context.keySystem]) == null ? void 0 : _this$config$drmSyste2.generateRequest;
22243
+ var generateRequestFilter = (_this$config$drmSyste = this.config.drmSystems) == null ? undefined : (_this$config$drmSyste2 = _this$config$drmSyste[context.keySystem]) == null ? undefined : _this$config$drmSyste2.generateRequest;
22243
22244
  if (generateRequestFilter) {
22244
22245
  try {
22245
22246
  var mappedInitData = generateRequestFilter.call(this.hls, initDataType, initData, context);
@@ -22332,7 +22333,7 @@
22332
22333
  });
22333
22334
  return context.mediaKeysSession.generateRequest(initDataType, initData).then(function () {
22334
22335
  var _context$mediaKeysSes;
22335
- _this8.log("Request generated for key-session \"" + ((_context$mediaKeysSes = context.mediaKeysSession) == null ? void 0 : _context$mediaKeysSes.sessionId) + "\" keyId: " + keyId);
22336
+ _this8.log("Request generated for key-session \"" + ((_context$mediaKeysSes = context.mediaKeysSession) == null ? undefined : _context$mediaKeysSes.sessionId) + "\" keyId: " + keyId);
22336
22337
  }).catch(function (error) {
22337
22338
  throw new EMEKeyError({
22338
22339
  type: ErrorTypes.KEY_SYSTEM_ERROR,
@@ -22419,7 +22420,7 @@
22419
22420
  var _this10 = this;
22420
22421
  return new Promise(function (resolve, reject) {
22421
22422
  mediaKeys.setServerCertificate(cert).then(function (success) {
22422
- _this10.log("setServerCertificate " + (success ? 'success' : 'not supported by CDM') + " (" + (cert == null ? void 0 : cert.byteLength) + ") on \"" + keySystem + "\"");
22423
+ _this10.log("setServerCertificate " + (success ? 'success' : 'not supported by CDM') + " (" + (cert == null ? undefined : cert.byteLength) + ") on \"" + keySystem + "\"");
22423
22424
  resolve(mediaKeys);
22424
22425
  }).catch(function (error) {
22425
22426
  reject(new EMEKeyError({
@@ -22467,15 +22468,15 @@
22467
22468
  for (var i = 0, len = headers.length; i < len; i++) {
22468
22469
  var _header$querySelector, _header$querySelector2;
22469
22470
  header = headers[i];
22470
- var name = (_header$querySelector = header.querySelector('name')) == null ? void 0 : _header$querySelector.textContent;
22471
- var value = (_header$querySelector2 = header.querySelector('value')) == null ? void 0 : _header$querySelector2.textContent;
22471
+ var name = (_header$querySelector = header.querySelector('name')) == null ? undefined : _header$querySelector.textContent;
22472
+ var value = (_header$querySelector2 = header.querySelector('value')) == null ? undefined : _header$querySelector2.textContent;
22472
22473
  if (name && value) {
22473
22474
  xhr.setRequestHeader(name, value);
22474
22475
  }
22475
22476
  }
22476
22477
  }
22477
22478
  var challengeElement = keyMessageXml.querySelector('Challenge');
22478
- var challengeText = challengeElement == null ? void 0 : challengeElement.textContent;
22479
+ var challengeText = challengeElement == null ? undefined : challengeElement.textContent;
22479
22480
  if (!challengeText) {
22480
22481
  throw new Error("Cannot find <Challenge> in key message");
22481
22482
  }
@@ -22614,10 +22615,10 @@
22614
22615
  var keySessionCount = mediaKeysList.length;
22615
22616
  EMEController.CDMCleanupPromise = Promise.all(mediaKeysList.map(function (mediaKeySessionContext) {
22616
22617
  return _this14.removeSession(mediaKeySessionContext);
22617
- }).concat(media == null ? void 0 : (_media$setMediaKeys = media.setMediaKeys(null)) == null ? void 0 : _media$setMediaKeys.catch(function (error) {
22618
+ }).concat(media == null ? undefined : (_media$setMediaKeys = media.setMediaKeys(null)) == null ? undefined : _media$setMediaKeys.catch(function (error) {
22618
22619
  var _this14$hls;
22619
22620
  _this14.log("Could not clear media keys: " + error);
22620
- (_this14$hls = _this14.hls) == null ? void 0 : _this14$hls.trigger(Events.ERROR, {
22621
+ (_this14$hls = _this14.hls) == null ? undefined : _this14$hls.trigger(Events.ERROR, {
22621
22622
  type: ErrorTypes.OTHER_ERROR,
22622
22623
  details: ErrorDetails.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,
22623
22624
  fatal: false,
@@ -22631,7 +22632,7 @@
22631
22632
  }).catch(function (error) {
22632
22633
  var _this14$hls2;
22633
22634
  _this14.log("Could not close sessions and clear media keys: " + error);
22634
- (_this14$hls2 = _this14.hls) == null ? void 0 : _this14$hls2.trigger(Events.ERROR, {
22635
+ (_this14$hls2 = _this14.hls) == null ? undefined : _this14$hls2.trigger(Events.ERROR, {
22635
22636
  type: ErrorTypes.OTHER_ERROR,
22636
22637
  details: ErrorDetails.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,
22637
22638
  fatal: false,
@@ -22683,7 +22684,7 @@
22683
22684
  return mediaKeysSession.remove().catch(function (error) {
22684
22685
  var _this15$hls;
22685
22686
  _this15.log("Could not remove session: " + error);
22686
- (_this15$hls = _this15.hls) == null ? void 0 : _this15$hls.trigger(Events.ERROR, {
22687
+ (_this15$hls = _this15.hls) == null ? undefined : _this15$hls.trigger(Events.ERROR, {
22687
22688
  type: ErrorTypes.OTHER_ERROR,
22688
22689
  details: ErrorDetails.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,
22689
22690
  fatal: false,
@@ -22694,7 +22695,7 @@
22694
22695
  }).catch(function (error) {
22695
22696
  var _this15$hls2;
22696
22697
  _this15.log("Could not close session: " + error);
22697
- (_this15$hls2 = _this15.hls) == null ? void 0 : _this15$hls2.trigger(Events.ERROR, {
22698
+ (_this15$hls2 = _this15.hls) == null ? undefined : _this15$hls2.trigger(Events.ERROR, {
22698
22699
  type: ErrorTypes.OTHER_ERROR,
22699
22700
  details: ErrorDetails.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,
22700
22701
  fatal: false,
@@ -22705,12 +22706,12 @@
22705
22706
  };
22706
22707
  return EMEController;
22707
22708
  }(Logger);
22708
- EMEController.CDMCleanupPromise = void 0;
22709
+ EMEController.CDMCleanupPromise = undefined;
22709
22710
  var EMEKeyError = /*#__PURE__*/function (_Error) {
22710
22711
  function EMEKeyError(data, message) {
22711
22712
  var _this16;
22712
22713
  _this16 = _Error.call(this, message) || this;
22713
- _this16.data = void 0;
22714
+ _this16.data = undefined;
22714
22715
  data.error || (data.error = new Error(message));
22715
22716
  _this16.data = data;
22716
22717
  data.err = data.error;
@@ -22722,15 +22723,15 @@
22722
22723
 
22723
22724
  var FPSController = /*#__PURE__*/function () {
22724
22725
  function FPSController(hls) {
22725
- this.hls = void 0;
22726
+ this.hls = undefined;
22726
22727
  this.isVideoPlaybackQualityAvailable = false;
22727
- this.timer = void 0;
22728
+ this.timer = undefined;
22728
22729
  this.media = null;
22729
- this.lastTime = void 0;
22730
+ this.lastTime = undefined;
22730
22731
  this.lastDroppedFrames = 0;
22731
22732
  this.lastDecodedFrames = 0;
22732
22733
  // stream controller must be provided as a dependency!
22733
- this.streamController = void 0;
22734
+ this.streamController = undefined;
22734
22735
  this.hls = hls;
22735
22736
  this.registerListeners();
22736
22737
  }
@@ -22841,12 +22842,12 @@
22841
22842
  }
22842
22843
  var InterstitialEvent = /*#__PURE__*/function () {
22843
22844
  function InterstitialEvent(dateRange, base) {
22844
- this.base = void 0;
22845
+ this.base = undefined;
22845
22846
  this._duration = null;
22846
22847
  this._timelineStart = null;
22847
- this.appendInPlaceDisabled = void 0;
22848
- this.appendInPlaceStarted = void 0;
22849
- this.dateRange = void 0;
22848
+ this.appendInPlaceDisabled = undefined;
22849
+ this.appendInPlaceStarted = undefined;
22850
+ this.dateRange = undefined;
22850
22851
  this.hasPlayed = false;
22851
22852
  this.cumulativeDuration = 0;
22852
22853
  this.resumeOffset = NaN;
@@ -22860,10 +22861,10 @@
22860
22861
  in: false
22861
22862
  };
22862
22863
  this.assetList = [];
22863
- this.assetListLoader = void 0;
22864
+ this.assetListLoader = undefined;
22864
22865
  this.assetListResponse = null;
22865
- this.resumeAnchor = void 0;
22866
- this.error = void 0;
22866
+ this.resumeAnchor = undefined;
22867
+ this.error = undefined;
22867
22868
  this.base = base;
22868
22869
  this.dateRange = dateRange;
22869
22870
  this.setDateRange(dateRange);
@@ -22878,7 +22879,7 @@
22878
22879
  };
22879
22880
  _proto.reset = function reset() {
22880
22881
  var _this$assetListLoader;
22881
- (_this$assetListLoader = this.assetListLoader) == null ? void 0 : _this$assetListLoader.destroy();
22882
+ (_this$assetListLoader = this.assetListLoader) == null ? undefined : _this$assetListLoader.destroy();
22882
22883
  this.assetListLoader = this.error = undefined;
22883
22884
  };
22884
22885
  _proto.isAssetPastPlayoutLimit = function isAssetPastPlayoutLimit(assetIndex) {
@@ -23061,9 +23062,9 @@
23061
23062
  var HlsAssetPlayer = /*#__PURE__*/function () {
23062
23063
  function HlsAssetPlayer(HlsPlayerClass, userConfig, _interstitial, assetItem) {
23063
23064
  var _this = this;
23064
- this.hls = void 0;
23065
- this.interstitial = void 0;
23066
- this.assetItem = void 0;
23065
+ this.hls = undefined;
23066
+ this.interstitial = undefined;
23067
+ this.assetItem = undefined;
23067
23068
  this.tracks = null;
23068
23069
  this.hasDetails = false;
23069
23070
  this.mediaAttached = null;
@@ -23099,7 +23100,7 @@
23099
23100
  var event = _this.interstitial;
23100
23101
  if (event.playoutLimit) {
23101
23102
  var _event$assetList$even;
23102
- _this.playoutOffset = ((_event$assetList$even = event.assetList[event.assetList.indexOf(assetItem)]) == null ? void 0 : _event$assetList$even.startOffset) || 0;
23103
+ _this.playoutOffset = ((_event$assetList$even = event.assetList[event.assetList.indexOf(assetItem)]) == null ? undefined : _event$assetList$even.startOffset) || 0;
23103
23104
  media.addEventListener('timeupdate', _this.checkPlayout);
23104
23105
  }
23105
23106
  });
@@ -23196,7 +23197,7 @@
23196
23197
  key: "duration",
23197
23198
  get: function get() {
23198
23199
  var _this$assetItem;
23199
- var duration = (_this$assetItem = this.assetItem) == null ? void 0 : _this$assetItem.duration;
23200
+ var duration = (_this$assetItem = this.assetItem) == null ? undefined : _this$assetItem.duration;
23200
23201
  if (!duration) {
23201
23202
  return 0;
23202
23203
  }
@@ -23236,7 +23237,7 @@
23236
23237
  function InterstitialsSchedule(onScheduleUpdate, logger) {
23237
23238
  var _this;
23238
23239
  _this = _Logger.call(this, 'interstitials-sched', logger) || this;
23239
- _this.onScheduleUpdate = void 0;
23240
+ _this.onScheduleUpdate = undefined;
23240
23241
  _this.eventMap = {};
23241
23242
  _this.events = null;
23242
23243
  _this.items = null;
@@ -23334,7 +23335,7 @@
23334
23335
  if (items) {
23335
23336
  for (var i = items.length; i--;) {
23336
23337
  var _items$i$event;
23337
- if (((_items$i$event = items[i].event) == null ? void 0 : _items$i$event.identifier) === identifier) {
23338
+ if (((_items$i$event = items[i].event) == null ? undefined : _items$i$event.identifier) === identifier) {
23338
23339
  return i;
23339
23340
  }
23340
23341
  }
@@ -23408,14 +23409,14 @@
23408
23409
  this.updateSchedule(mediaSelection, removedInterstitials);
23409
23410
  };
23410
23411
  _proto.updateSchedule = function updateSchedule(mediaSelection, removedInterstitials) {
23411
- if (removedInterstitials === void 0) {
23412
+ if (removedInterstitials === undefined) {
23412
23413
  removedInterstitials = [];
23413
23414
  }
23414
23415
  var events = this.events || [];
23415
23416
  if (events.length || removedInterstitials.length || this.length < 2) {
23416
23417
  var currentItems = this.items;
23417
23418
  var updatedItems = this.parseSchedule(events, mediaSelection);
23418
- var updated = removedInterstitials.length || (currentItems == null ? void 0 : currentItems.length) !== updatedItems.length || updatedItems.some(function (item, i) {
23419
+ var updated = removedInterstitials.length || (currentItems == null ? undefined : currentItems.length) !== updatedItems.length || updatedItems.some(function (item, i) {
23419
23420
  return Math.abs(item.playout.start - currentItems[i].playout.start) > 0.005 || Math.abs(item.playout.end - currentItems[i].playout.end) > 0.005;
23420
23421
  });
23421
23422
  if (updated) {
@@ -23472,7 +23473,7 @@
23472
23473
  var interstitialDuration = interstitial.duration;
23473
23474
  var timelineDuration = interstitial.timelineOccupancy === TimelineOccupancy.Range ? interstitialDuration : 0;
23474
23475
  var resumptionOffset = interstitial.resumptionOffset;
23475
- var inSameStartTimeSequence = (previousEvent == null ? void 0 : previousEvent.startTime) === eventStart;
23476
+ var inSameStartTimeSequence = (previousEvent == null ? undefined : previousEvent.startTime) === eventStart;
23476
23477
  var start = eventStart + interstitial.cumulativeDuration;
23477
23478
  var end = appendInPlace ? start + interstitialDuration : eventStart + resumptionOffset;
23478
23479
  if (preroll || !postroll && eventStart <= 0) {
@@ -23570,7 +23571,7 @@
23570
23571
  var playoutStart = playoutDuration;
23571
23572
  playoutDuration += segmentDuration;
23572
23573
  schedule.push({
23573
- previousEvent: ((_schedule = schedule[schedule.length - 1]) == null ? void 0 : _schedule.event) || null,
23574
+ previousEvent: ((_schedule = schedule[schedule.length - 1]) == null ? undefined : _schedule.event) || null,
23574
23575
  nextEvent: null,
23575
23576
  start: primaryPosition,
23576
23577
  end: timelineStart + segmentDuration,
@@ -23733,7 +23734,7 @@
23733
23734
  key: "assetIdAtEnd",
23734
23735
  get: function get() {
23735
23736
  var _this$items, _this$items2;
23736
- var interstitialAtEnd = (_this$items = this.items) == null ? void 0 : (_this$items2 = _this$items[this.length - 1]) == null ? void 0 : _this$items2.event;
23737
+ var interstitialAtEnd = (_this$items = this.items) == null ? undefined : (_this$items2 = _this$items[this.length - 1]) == null ? undefined : _this$items2.event;
23737
23738
  if (interstitialAtEnd) {
23738
23739
  var assetList = interstitialAtEnd.assetList;
23739
23740
  var assetAtEnd = assetList[assetList.length - 1];
@@ -23751,7 +23752,7 @@
23751
23752
 
23752
23753
  var AssetListLoader = /*#__PURE__*/function () {
23753
23754
  function AssetListLoader(hls) {
23754
- this.hls = void 0;
23755
+ this.hls = undefined;
23755
23756
  this.hls = hls;
23756
23757
  }
23757
23758
  var _proto = AssetListLoader.prototype;
@@ -23794,7 +23795,7 @@
23794
23795
  var callbacks = {
23795
23796
  onSuccess: function onSuccess(response, stats, context, networkDetails) {
23796
23797
  var assetListResponse = response.data;
23797
- var assets = assetListResponse == null ? void 0 : assetListResponse.ASSETS;
23798
+ var assets = assetListResponse == null ? undefined : assetListResponse.ASSETS;
23798
23799
  if (!Array.isArray(assets)) {
23799
23800
  var _errorData = _this.assignAssetListError(interstitial, ErrorDetails.ASSET_LIST_PARSING_ERROR, new Error("Invalid interstitial asset list"), context.url, stats, networkDetails);
23800
23801
  _this.hls.trigger(Events.ERROR, _errorData);
@@ -23839,7 +23840,7 @@
23839
23840
  }();
23840
23841
 
23841
23842
  function playWithCatch(media) {
23842
- media == null ? void 0 : media.play().catch(function () {
23843
+ media == null ? undefined : media.play().catch(function () {
23843
23844
  /* no-op */
23844
23845
  });
23845
23846
  }
@@ -23847,9 +23848,9 @@
23847
23848
  function InterstitialsController(hls, HlsPlayerClass) {
23848
23849
  var _this;
23849
23850
  _this = _Logger.call(this, 'interstitials', hls.logger) || this;
23850
- _this.HlsPlayerClass = void 0;
23851
- _this.hls = void 0;
23852
- _this.assetListLoader = void 0;
23851
+ _this.HlsPlayerClass = undefined;
23852
+ _this.hls = undefined;
23853
+ _this.assetListLoader = undefined;
23853
23854
  // Last updated LevelDetails
23854
23855
  _this.mediaSelection = null;
23855
23856
  _this.altSelection = null;
@@ -23865,7 +23866,7 @@
23865
23866
  _this.bufferedPos = -1;
23866
23867
  _this.timelinePos = -1;
23867
23868
  // Schedule
23868
- _this.schedule = void 0;
23869
+ _this.schedule = undefined;
23869
23870
  // Schedule playback and buffering state
23870
23871
  _this.playingItem = null;
23871
23872
  _this.bufferingItem = null;
@@ -24249,7 +24250,7 @@
24249
24250
  var primaryPlayer = this.hls;
24250
24251
  var isAssetPlayer = player !== primaryPlayer;
24251
24252
  var appendInPlace = isAssetPlayer && player.interstitial.appendInPlace;
24252
- var detachedMediaSource = (_this$detachedData = this.detachedData) == null ? void 0 : _this$detachedData.mediaSource;
24253
+ var detachedMediaSource = (_this$detachedData = this.detachedData) == null ? undefined : _this$detachedData.mediaSource;
24253
24254
  var logFromSource;
24254
24255
  if (primaryPlayer.media && appendInPlace) {
24255
24256
  attachMediaSourceData = primaryPlayer.transferMedia();
@@ -24277,7 +24278,7 @@
24277
24278
  };
24278
24279
  }
24279
24280
  }
24280
- var transferring = attachMediaSourceData && 'mediaSource' in attachMediaSourceData && ((_attachMediaSourceDat = attachMediaSourceData.mediaSource) == null ? void 0 : _attachMediaSourceDat.readyState) !== 'closed';
24281
+ var transferring = attachMediaSourceData && 'mediaSource' in attachMediaSourceData && ((_attachMediaSourceDat = attachMediaSourceData.mediaSource) == null ? undefined : _attachMediaSourceDat.readyState) !== 'closed';
24281
24282
  var dataToAttach = transferring && attachMediaSourceData ? attachMediaSourceData : media;
24282
24283
  this.log((transferring ? 'transfering MediaSource' : 'attaching media') + " to " + (isAssetPlayer ? player : 'Primary'));
24283
24284
  if (dataToAttach === attachMediaSourceData) {
@@ -24368,9 +24369,9 @@
24368
24369
  var _interstitial$assetLi;
24369
24370
  var interstitial = currentItem.event;
24370
24371
  var playingAsset = this.playingAsset;
24371
- var assetId = playingAsset == null ? void 0 : playingAsset.identifier;
24372
+ var assetId = playingAsset == null ? undefined : playingAsset.identifier;
24372
24373
  var player = assetId ? this.getAssetPlayer(assetId) : null;
24373
- if (player && assetId && (!this.eventItemsMatch(currentItem, scheduledItem) || assetListIndex !== undefined && assetId !== ((_interstitial$assetLi = interstitial.assetList) == null ? void 0 : _interstitial$assetLi[assetListIndex].identifier))) {
24374
+ if (player && assetId && (!this.eventItemsMatch(currentItem, scheduledItem) || assetListIndex !== undefined && assetId !== ((_interstitial$assetLi = interstitial.assetList) == null ? undefined : _interstitial$assetLi[assetListIndex].identifier))) {
24374
24375
  this.playingAsset = null;
24375
24376
  var _assetListIndex = interstitial.findAssetIndex(playingAsset);
24376
24377
  this.log("INTERSTITIAL_ASSET_ENDED " + (_assetListIndex + 1) + "/" + interstitial.assetList.length + " " + eventAssetToString(playingAsset));
@@ -24691,7 +24692,7 @@
24691
24692
  if (interstitial.cue.post) {
24692
24693
  var _this$schedule$items;
24693
24694
  var scheduleIndex = this.schedule.findEventIndex(interstitial.identifier);
24694
- var item = (_this$schedule$items = this.schedule.items) == null ? void 0 : _this$schedule$items[scheduleIndex];
24695
+ var item = (_this$schedule$items = this.schedule.items) == null ? undefined : _this$schedule$items[scheduleIndex];
24695
24696
  if (this.isInterstitial(item) && this.eventItemsMatch(item, this.bufferingItem)) {
24696
24697
  this.bufferedToItem(item, 0);
24697
24698
  }
@@ -24719,11 +24720,11 @@
24719
24720
  };
24720
24721
  _proto.itemsMatch = function itemsMatch(a, b) {
24721
24722
  var _a$nextEvent, _b$nextEvent;
24722
- return !!b && (a === b || a.event && b.event && this.eventItemsMatch(a, b) || !a.event && !b.event && ((_a$nextEvent = a.nextEvent) == null ? void 0 : _a$nextEvent.identifier) === ((_b$nextEvent = b.nextEvent) == null ? void 0 : _b$nextEvent.identifier));
24723
+ return !!b && (a === b || a.event && b.event && this.eventItemsMatch(a, b) || !a.event && !b.event && ((_a$nextEvent = a.nextEvent) == null ? undefined : _a$nextEvent.identifier) === ((_b$nextEvent = b.nextEvent) == null ? undefined : _b$nextEvent.identifier));
24723
24724
  };
24724
24725
  _proto.eventItemsMatch = function eventItemsMatch(a, b) {
24725
24726
  var _b$event;
24726
- return !!b && (a === b || a.event.identifier === ((_b$event = b.event) == null ? void 0 : _b$event.identifier));
24727
+ return !!b && (a === b || a.event.identifier === ((_b$event = b.event) == null ? undefined : _b$event.identifier));
24727
24728
  };
24728
24729
  _proto.findItemIndex = function findItemIndex(item, time) {
24729
24730
  return item ? this.schedule.findItemIndex(item, time) : -1;
@@ -24768,7 +24769,7 @@
24768
24769
  if (bufferEndIndex === -1 && bufferingItem && bufferEnd >= bufferingItem.end) {
24769
24770
  bufferEndIndex = nextToBufferIndex;
24770
24771
  }
24771
- if (nextToBufferIndex - playingIndex > 1 && (bufferingItem == null ? void 0 : (_bufferingItem$event = bufferingItem.event) == null ? void 0 : _bufferingItem$event.appendInPlace) === false) {
24772
+ if (nextToBufferIndex - playingIndex > 1 && (bufferingItem == null ? undefined : (_bufferingItem$event = bufferingItem.event) == null ? undefined : _bufferingItem$event.appendInPlace) === false) {
24772
24773
  // do not advance buffering item past Interstitial that requires source reset
24773
24774
  return;
24774
24775
  }
@@ -24826,7 +24827,7 @@
24826
24827
  return bufferingLast;
24827
24828
  };
24828
24829
  _proto.bufferedToItem = function bufferedToItem(item, assetListIndex) {
24829
- if (assetListIndex === void 0) {
24830
+ if (assetListIndex === undefined) {
24830
24831
  assetListIndex = 0;
24831
24832
  }
24832
24833
  var bufferingLast = this.setBufferingItem(item);
@@ -25082,13 +25083,13 @@
25082
25083
  var scheduleIndex = _this4.schedule.findEventIndex(interstitial.identifier);
25083
25084
  var assetListIndex = interstitial.findAssetIndex(assetItem);
25084
25085
  var nextAssetIndex = assetListIndex + 1;
25085
- var item = (_this4$schedule$items = _this4.schedule.items) == null ? void 0 : _this4$schedule$items[scheduleIndex];
25086
+ var item = (_this4$schedule$items = _this4.schedule.items) == null ? undefined : _this4$schedule$items[scheduleIndex];
25086
25087
  if (_this4.isInterstitial(item)) {
25087
25088
  if (assetListIndex !== -1 && !interstitial.isAssetPastPlayoutLimit(nextAssetIndex) && !interstitial.assetList[nextAssetIndex].error) {
25088
25089
  _this4.bufferedToItem(item, assetListIndex + 1);
25089
25090
  } else {
25090
25091
  var _this4$schedule$items2;
25091
- var nextItem = (_this4$schedule$items2 = _this4.schedule.items) == null ? void 0 : _this4$schedule$items2[scheduleIndex + 1];
25092
+ var nextItem = (_this4$schedule$items2 = _this4.schedule.items) == null ? undefined : _this4$schedule$items2[scheduleIndex + 1];
25092
25093
  if (nextItem) {
25093
25094
  _this4.bufferedToItem(nextItem);
25094
25095
  }
@@ -25197,7 +25198,7 @@
25197
25198
  assetItem = player.assetItem,
25198
25199
  assetId = player.assetId;
25199
25200
  var scheduleIndex = this.schedule.findEventIndex(interstitial.identifier);
25200
- var item = (_this$schedule$items2 = this.schedule.items) == null ? void 0 : _this$schedule$items2[scheduleIndex];
25201
+ var item = (_this$schedule$items2 = this.schedule.items) == null ? undefined : _this$schedule$items2[scheduleIndex];
25201
25202
  if (!item) {
25202
25203
  return;
25203
25204
  }
@@ -25207,7 +25208,7 @@
25207
25208
  if (bufferingPlayer === player) {
25208
25209
  return;
25209
25210
  }
25210
- var activeTracks = (bufferingPlayer == null ? void 0 : bufferingPlayer.tracks) || ((_this$detachedData3 = this.detachedData) == null ? void 0 : _this$detachedData3.tracks) || this.requiredTracks;
25211
+ var activeTracks = (bufferingPlayer == null ? undefined : bufferingPlayer.tracks) || ((_this$detachedData3 = this.detachedData) == null ? undefined : _this$detachedData3.tracks) || this.requiredTracks;
25211
25212
  if (interstitial.appendInPlace && assetItem !== this.playingAsset) {
25212
25213
  // Do not buffer another item if tracks are unknown or incompatible
25213
25214
  if (!player.tracks) {
@@ -25321,23 +25322,23 @@
25321
25322
  });
25322
25323
  interstitial.duration = sumDuration;
25323
25324
  var waitingItem = this.waitingItem;
25324
- var waitingForItem = (waitingItem == null ? void 0 : waitingItem.event.identifier) === interstitialId;
25325
+ var waitingForItem = (waitingItem == null ? undefined : waitingItem.event.identifier) === interstitialId;
25325
25326
 
25326
25327
  // Update schedule now that asset.DURATION(s) are parsed
25327
25328
  this.updateSchedule();
25328
- var bufferingEvent = (_this$bufferingItem = this.bufferingItem) == null ? void 0 : _this$bufferingItem.event;
25329
+ var bufferingEvent = (_this$bufferingItem = this.bufferingItem) == null ? undefined : _this$bufferingItem.event;
25329
25330
 
25330
25331
  // If buffer reached Interstitial, start buffering first asset
25331
25332
  if (waitingForItem) {
25332
25333
  var _this$schedule$items3;
25333
25334
  // Advance schedule when waiting for asset list data to play
25334
25335
  var scheduleIndex = this.schedule.findEventIndex(interstitialId);
25335
- var item = (_this$schedule$items3 = this.schedule.items) == null ? void 0 : _this$schedule$items3[scheduleIndex];
25336
+ var item = (_this$schedule$items3 = this.schedule.items) == null ? undefined : _this$schedule$items3[scheduleIndex];
25336
25337
  if (item) {
25337
25338
  this.setBufferingItem(item);
25338
25339
  }
25339
25340
  this.setSchedulePosition(scheduleIndex);
25340
- } else if ((bufferingEvent == null ? void 0 : bufferingEvent.identifier) === interstitialId && bufferingEvent.appendInPlace) {
25341
+ } else if ((bufferingEvent == null ? undefined : bufferingEvent.identifier) === interstitialId && bufferingEvent.appendInPlace) {
25341
25342
  // If buffering (but not playback) has reached this item transfer media-source
25342
25343
  var assetItem = interstitial.assetList[0];
25343
25344
  var player = this.getAssetPlayer(assetItem.identifier);
@@ -25384,7 +25385,7 @@
25384
25385
  if (interstitial) {
25385
25386
  if (timelineType === 'playout' || interstitial.timelineOccupancy !== TimelineOccupancy.Point) {
25386
25387
  var assetPlayer = getAssetPlayer(asset);
25387
- if ((assetPlayer == null ? void 0 : assetPlayer.interstitial) === interstitial) {
25388
+ if ((assetPlayer == null ? undefined : assetPlayer.interstitial) === interstitial) {
25388
25389
  time += assetPlayer.assetItem.startOffset + assetPlayer[assetPlayerField];
25389
25390
  }
25390
25391
  }
@@ -25400,7 +25401,7 @@
25400
25401
  if (primaryTime !== 0 && timelineType !== 'primary' && c.schedule.length) {
25401
25402
  var _c$schedule$items;
25402
25403
  var index = c.schedule.findItemIndexAtTime(primaryTime);
25403
- var item = (_c$schedule$items = c.schedule.items) == null ? void 0 : _c$schedule$items[index];
25404
+ var item = (_c$schedule$items = c.schedule.items) == null ? undefined : _c$schedule$items[index];
25404
25405
  if (item) {
25405
25406
  var diff = item[timelineType].start - item.start;
25406
25407
  return primaryTime + diff;
@@ -25432,14 +25433,14 @@
25432
25433
  c.log("seek to " + time + " \"" + timelineType + "\"");
25433
25434
  var playingItem = effectivePlayingItem();
25434
25435
  var targetIndex = c.schedule.findItemIndexAtTime(time, timelineType);
25435
- var targetItem = (_c$schedule$items2 = c.schedule.items) == null ? void 0 : _c$schedule$items2[targetIndex];
25436
- var playingInterstitial = playingItem == null ? void 0 : playingItem.event;
25437
- var appendInPlace = playingInterstitial == null ? void 0 : playingInterstitial.appendInPlace;
25436
+ var targetItem = (_c$schedule$items2 = c.schedule.items) == null ? undefined : _c$schedule$items2[targetIndex];
25437
+ var playingInterstitial = playingItem == null ? undefined : playingItem.event;
25438
+ var appendInPlace = playingInterstitial == null ? undefined : playingInterstitial.appendInPlace;
25438
25439
  var seekInItem = playingItem && c.itemsMatch(playingItem, targetItem);
25439
25440
  if (playingItem && (appendInPlace || seekInItem)) {
25440
25441
  // seek in asset player or primary media (appendInPlace)
25441
25442
  var assetPlayer = getAssetPlayer(c.playingAsset);
25442
- var media = (assetPlayer == null ? void 0 : assetPlayer.media) || c.hls.media;
25443
+ var media = (assetPlayer == null ? undefined : assetPlayer.media) || c.hls.media;
25443
25444
  if (media) {
25444
25445
  var currentTime = timelineType === 'primary' ? media.currentTime : getMappedTime(playingItem, timelineType, c.playingAsset, 'timelinePos', 'currentTime');
25445
25446
  var diff = time - currentTime;
@@ -25479,7 +25480,7 @@
25479
25480
  c.timelinePos = _seekToTime;
25480
25481
  } else {
25481
25482
  var _targetItem$event;
25482
- var assetList = targetItem == null ? void 0 : (_targetItem$event = targetItem.event) == null ? void 0 : _targetItem$event.assetList;
25483
+ var assetList = targetItem == null ? undefined : (_targetItem$event = targetItem.event) == null ? undefined : _targetItem$event.assetList;
25483
25484
  if (assetList) {
25484
25485
  var eventTime = time - (targetItem[timelineType] || targetItem).start;
25485
25486
  for (var i = assetList.length; i--;) {
@@ -25498,11 +25499,11 @@
25498
25499
  this.manager = {
25499
25500
  get events() {
25500
25501
  var _c$schedule, _c$schedule$events;
25501
- return ((_c$schedule = c.schedule) == null ? void 0 : (_c$schedule$events = _c$schedule.events) == null ? void 0 : _c$schedule$events.slice(0)) || [];
25502
+ return ((_c$schedule = c.schedule) == null ? undefined : (_c$schedule$events = _c$schedule.events) == null ? undefined : _c$schedule$events.slice(0)) || [];
25502
25503
  },
25503
25504
  get schedule() {
25504
25505
  var _c$schedule2, _c$schedule2$items;
25505
- return ((_c$schedule2 = c.schedule) == null ? void 0 : (_c$schedule2$items = _c$schedule2.items) == null ? void 0 : _c$schedule2$items.slice(0)) || [];
25506
+ return ((_c$schedule2 = c.schedule) == null ? undefined : (_c$schedule2$items = _c$schedule2.items) == null ? undefined : _c$schedule2$items.slice(0)) || [];
25506
25507
  },
25507
25508
  get playerQueue() {
25508
25509
  return c.playerQueue.slice(0);
@@ -25546,7 +25547,7 @@
25546
25547
  },
25547
25548
  get seekableStart() {
25548
25549
  var _c$primaryDetails2;
25549
- return ((_c$primaryDetails2 = c.primaryDetails) == null ? void 0 : _c$primaryDetails2.fragmentStart) || 0;
25550
+ return ((_c$primaryDetails2 = c.primaryDetails) == null ? undefined : _c$primaryDetails2.fragmentStart) || 0;
25550
25551
  },
25551
25552
  seekTo: function seekTo(time) {
25552
25553
  return _seekTo(time, 'primary');
@@ -25564,7 +25565,7 @@
25564
25565
  },
25565
25566
  get seekableStart() {
25566
25567
  var _c$primaryDetails3;
25567
- return findMappedTime(((_c$primaryDetails3 = c.primaryDetails) == null ? void 0 : _c$primaryDetails3.fragmentStart) || 0, 'playout');
25568
+ return findMappedTime(((_c$primaryDetails3 = c.primaryDetails) == null ? undefined : _c$primaryDetails3.fragmentStart) || 0, 'playout');
25568
25569
  },
25569
25570
  seekTo: function seekTo(time) {
25570
25571
  return _seekTo(time, 'playout');
@@ -25582,7 +25583,7 @@
25582
25583
  },
25583
25584
  get seekableStart() {
25584
25585
  var _c$primaryDetails4;
25585
- return findMappedTime(((_c$primaryDetails4 = c.primaryDetails) == null ? void 0 : _c$primaryDetails4.fragmentStart) || 0, 'integrated');
25586
+ return findMappedTime(((_c$primaryDetails4 = c.primaryDetails) == null ? undefined : _c$primaryDetails4.fragmentStart) || 0, 'integrated');
25586
25587
  },
25587
25588
  seekTo: function seekTo(time) {
25588
25589
  return _seekTo(time, 'integrated');
@@ -25590,7 +25591,7 @@
25590
25591
  },
25591
25592
  skip: function skip() {
25592
25593
  var item = effectivePlayingItem();
25593
- var event = item == null ? void 0 : item.event;
25594
+ var event = item == null ? undefined : item.event;
25594
25595
  if (event && !event.restrictions.skip) {
25595
25596
  var index = c.findItemIndex(item);
25596
25597
  if (event.appendInPlace) {
@@ -25615,7 +25616,7 @@
25615
25616
  if (!this.playbackStarted || !playingItem) {
25616
25617
  return false;
25617
25618
  }
25618
- var items = (_this$schedule = this.schedule) == null ? void 0 : _this$schedule.items;
25619
+ var items = (_this$schedule = this.schedule) == null ? undefined : _this$schedule.items;
25619
25620
  return this.itemsMatch(playingItem, items ? items[items.length - 1] : null);
25620
25621
  }
25621
25622
  }, {
@@ -25643,7 +25644,7 @@
25643
25644
  // Observe detached media currentTime when appending in place
25644
25645
  media = this.primaryMedia;
25645
25646
  }
25646
- var currentTime = (_media3 = media) == null ? void 0 : _media3.currentTime;
25647
+ var currentTime = (_media3 = media) == null ? undefined : _media3.currentTime;
25647
25648
  if (currentTime === undefined || !isFiniteNumber(currentTime)) {
25648
25649
  return undefined;
25649
25650
  }
@@ -25653,7 +25654,7 @@
25653
25654
  key: "primaryMedia",
25654
25655
  get: function get() {
25655
25656
  var _this$detachedData4;
25656
- return this.media || ((_this$detachedData4 = this.detachedData) == null ? void 0 : _this$detachedData4.media) || null;
25657
+ return this.media || ((_this$detachedData4 = this.detachedData) == null ? undefined : _this$detachedData4.media) || null;
25657
25658
  }
25658
25659
  }, {
25659
25660
  key: "playbackDisabled",
@@ -25664,7 +25665,7 @@
25664
25665
  key: "primaryDetails",
25665
25666
  get: function get() {
25666
25667
  var _this$mediaSelection, _this$mediaSelection$;
25667
- return (_this$mediaSelection = this.mediaSelection) == null ? void 0 : (_this$mediaSelection$ = _this$mediaSelection.main) == null ? void 0 : _this$mediaSelection$.details;
25668
+ return (_this$mediaSelection = this.mediaSelection) == null ? undefined : (_this$mediaSelection$ = _this$mediaSelection.main) == null ? undefined : _this$mediaSelection$.details;
25668
25669
  }
25669
25670
  }, {
25670
25671
  key: "primaryLive",
@@ -25803,7 +25804,7 @@
25803
25804
  ;
25804
25805
  _proto.onError = function onError(event, data) {
25805
25806
  var frag = data.frag;
25806
- if ((frag == null ? void 0 : frag.type) === PlaylistLevelType.SUBTITLE) {
25807
+ if ((frag == null ? undefined : frag.type) === PlaylistLevelType.SUBTITLE) {
25807
25808
  if (data.details === ErrorDetails.FRAG_GAP) {
25808
25809
  this.fragmentTracker.fragBuffered(frag, true);
25809
25810
  }
@@ -25893,7 +25894,7 @@
25893
25894
  }
25894
25895
  } else {
25895
25896
  var _this$levelLastLoaded;
25896
- sliding = this.alignPlaylists(newDetails, track.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ? void 0 : _this$levelLastLoaded.details);
25897
+ sliding = this.alignPlaylists(newDetails, track.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ? undefined : _this$levelLastLoaded.details);
25897
25898
  if (sliding === 0 && mainSlidingStartFragment) {
25898
25899
  // realign with main when there is no overlap with last refresh
25899
25900
  sliding = mainSlidingStartFragment.start;
@@ -25971,7 +25972,7 @@
25971
25972
  if (this.state === State.IDLE) {
25972
25973
  var currentTrackId = this.currentTrackId,
25973
25974
  levels = this.levels;
25974
- var track = levels == null ? void 0 : levels[currentTrackId];
25975
+ var track = levels == null ? undefined : levels[currentTrackId];
25975
25976
  if (!track || !levels.length || !track.details) {
25976
25977
  return;
25977
25978
  }
@@ -26036,7 +26037,7 @@
26036
26037
  }]);
26037
26038
  }(BaseStreamController);
26038
26039
  var BufferableInstance = function BufferableInstance(timeranges) {
26039
- this.buffered = void 0;
26040
+ this.buffered = undefined;
26040
26041
  var getRange = function getRange(name, index, length) {
26041
26042
  index = index >>> 0;
26042
26043
  if (index > length - 1) {
@@ -26341,7 +26342,7 @@
26341
26342
  details = data.details;
26342
26343
  var trackInActiveGroup = this.tracksInGroup[id];
26343
26344
  if (!trackInActiveGroup || trackInActiveGroup.groupId !== groupId) {
26344
- this.warn("Subtitle track with id:" + id + " and group:" + groupId + " not found in active group " + (trackInActiveGroup == null ? void 0 : trackInActiveGroup.groupId));
26345
+ this.warn("Subtitle track with id:" + id + " and group:" + groupId + " not found in active group " + (trackInActiveGroup == null ? undefined : trackInActiveGroup.groupId));
26345
26346
  return;
26346
26347
  }
26347
26348
  var curDetails = trackInActiveGroup.details;
@@ -26365,8 +26366,8 @@
26365
26366
  var subtitleGroups = levelInfo.subtitleGroups || null;
26366
26367
  var currentGroups = this.groupIds;
26367
26368
  var currentTrack = this.currentTrack;
26368
- if (!subtitleGroups || (currentGroups == null ? void 0 : currentGroups.length) !== (subtitleGroups == null ? void 0 : subtitleGroups.length) || subtitleGroups != null && subtitleGroups.some(function (groupId) {
26369
- return (currentGroups == null ? void 0 : currentGroups.indexOf(groupId)) === -1;
26369
+ if (!subtitleGroups || (currentGroups == null ? undefined : currentGroups.length) !== (subtitleGroups == null ? undefined : subtitleGroups.length) || subtitleGroups != null && subtitleGroups.some(function (groupId) {
26370
+ return (currentGroups == null ? undefined : currentGroups.indexOf(groupId)) === -1;
26370
26371
  })) {
26371
26372
  this.groupIds = subtitleGroups;
26372
26373
  this.trackId = -1;
@@ -26414,7 +26415,7 @@
26414
26415
  var subtitleTracksUpdated = {
26415
26416
  subtitleTracks: subtitleTracks
26416
26417
  };
26417
- this.log("Updating subtitle tracks, " + subtitleTracks.length + " track(s) found in \"" + (subtitleGroups == null ? void 0 : subtitleGroups.join(',')) + "\" group-id");
26418
+ this.log("Updating subtitle tracks, " + subtitleTracks.length + " track(s) found in \"" + (subtitleGroups == null ? undefined : subtitleGroups.join(',')) + "\" group-id");
26418
26419
  this.hls.trigger(Events.SUBTITLE_TRACKS_UPDATED, subtitleTracksUpdated);
26419
26420
  if (trackId !== -1 && this.trackId === -1) {
26420
26421
  this.setSubtitleTrack(trackId);
@@ -26517,8 +26518,8 @@
26517
26518
  var groupId = currentTrack.groupId;
26518
26519
  var url = this.getUrlWithDirectives(currentTrack.url, hlsUrlParameters);
26519
26520
  var details = currentTrack.details;
26520
- var age = details == null ? void 0 : details.age;
26521
- this.log("Loading subtitle " + id + " \"" + currentTrack.name + "\" lang:" + currentTrack.lang + " group:" + groupId + ((hlsUrlParameters == null ? void 0 : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : '') + (age && details.live ? ' age ' + age.toFixed(1) + (details.type ? ' ' + details.type || '' : '') : '') + " " + url);
26521
+ var age = details == null ? undefined : details.age;
26522
+ this.log("Loading subtitle " + id + " \"" + currentTrack.name + "\" lang:" + currentTrack.lang + " group:" + groupId + ((hlsUrlParameters == null ? undefined : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : '') + (age && details.live ? ' age ' + age.toFixed(1) + (details.type ? ' ' + details.type || '' : '') : '') + " " + url);
26522
26523
  this.hls.trigger(Events.SUBTITLE_TRACK_LOADING, {
26523
26524
  url: url,
26524
26525
  id: id,
@@ -26603,7 +26604,7 @@
26603
26604
  this.log("Switching to subtitle-track " + newId + (track ? " \"" + track.name + "\" lang:" + track.lang + " group:" + track.groupId : ''));
26604
26605
  var id = track.id,
26605
26606
  _track$groupId = track.groupId,
26606
- groupId = _track$groupId === void 0 ? '' : _track$groupId,
26607
+ groupId = _track$groupId === undefined ? '' : _track$groupId,
26607
26608
  name = track.name,
26608
26609
  type = track.type,
26609
26610
  url = track.url;
@@ -26614,7 +26615,7 @@
26614
26615
  type: type,
26615
26616
  url: url
26616
26617
  });
26617
- var hlsUrlParameters = this.switchParams(track.url, lastTrack == null ? void 0 : lastTrack.details, track.details);
26618
+ var hlsUrlParameters = this.switchParams(track.url, lastTrack == null ? undefined : lastTrack.details, track.details);
26618
26619
  this.loadPlaylist(hlsUrlParameters);
26619
26620
  };
26620
26621
  return _createClass(SubtitleTrackController, [{
@@ -27039,7 +27040,7 @@
27039
27040
  this.pos = 0;
27040
27041
  this.currPenState = new PenState();
27041
27042
  this.cueStartTime = null;
27042
- this.logger = void 0;
27043
+ this.logger = undefined;
27043
27044
  for (var i = 0; i < NR_COLS; i++) {
27044
27045
  this.chars.push(new StyledUnicodeChar());
27045
27046
  }
@@ -27170,7 +27171,7 @@
27170
27171
  this.currRow = NR_ROWS - 1;
27171
27172
  this.nrRollUpRows = null;
27172
27173
  this.lastOutputScreen = null;
27173
- this.logger = void 0;
27174
+ this.logger = undefined;
27174
27175
  for (var i = 0; i < NR_ROWS; i++) {
27175
27176
  this.rows.push(new Row(logger));
27176
27177
  }
@@ -27355,17 +27356,17 @@
27355
27356
  // var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];
27356
27357
  var Cea608Channel = /*#__PURE__*/function () {
27357
27358
  function Cea608Channel(channelNumber, outputFilter, logger) {
27358
- this.chNr = void 0;
27359
- this.outputFilter = void 0;
27360
- this.mode = void 0;
27361
- this.verbose = void 0;
27362
- this.displayedMemory = void 0;
27363
- this.nonDisplayedMemory = void 0;
27364
- this.lastOutputScreen = void 0;
27365
- this.currRollUpRow = void 0;
27366
- this.writeScreen = void 0;
27367
- this.cueStartTime = void 0;
27368
- this.logger = void 0;
27359
+ this.chNr = undefined;
27360
+ this.outputFilter = undefined;
27361
+ this.mode = undefined;
27362
+ this.verbose = undefined;
27363
+ this.displayedMemory = undefined;
27364
+ this.nonDisplayedMemory = undefined;
27365
+ this.lastOutputScreen = undefined;
27366
+ this.currRollUpRow = undefined;
27367
+ this.writeScreen = undefined;
27368
+ this.cueStartTime = undefined;
27369
+ this.logger = undefined;
27369
27370
  this.chNr = channelNumber;
27370
27371
  this.outputFilter = outputFilter;
27371
27372
  this.mode = null;
@@ -27551,7 +27552,7 @@
27551
27552
  this.writeScreen.setPen(styles);
27552
27553
  };
27553
27554
  _proto6.outputDataUpdate = function outputDataUpdate(dispatch) {
27554
- if (dispatch === void 0) {
27555
+ if (dispatch === undefined) {
27555
27556
  dispatch = false;
27556
27557
  }
27557
27558
  var time = this.logger.time;
@@ -27588,10 +27589,10 @@
27588
27589
  }(); // Will be 1 or 2 when parsing captions
27589
27590
  var Cea608Parser = /*#__PURE__*/function () {
27590
27591
  function Cea608Parser(field, out1, out2) {
27591
- this.channels = void 0;
27592
+ this.channels = undefined;
27592
27593
  this.currentChannel = 0;
27593
27594
  this.cmdHistory = createCmdHistory();
27594
- this.logger = void 0;
27595
+ this.logger = undefined;
27595
27596
  var logger = this.logger = new CaptionsLogger();
27596
27597
  this.channels = [null, new Cea608Channel(field, out1, logger), new Cea608Channel(field + 1, out2, logger)];
27597
27598
  }
@@ -28421,9 +28422,9 @@
28421
28422
  this.decoder = new StringDecoder();
28422
28423
  this.regionList = [];
28423
28424
  this.cue = null;
28424
- this.oncue = void 0;
28425
- this.onparsingerror = void 0;
28426
- this.onflush = void 0;
28425
+ this.oncue = undefined;
28426
+ this.onparsingerror = undefined;
28427
+ this.onflush = undefined;
28427
28428
  }
28428
28429
  var _proto3 = VTTParser.prototype;
28429
28430
  _proto3.parse = function parse(data) {
@@ -28626,7 +28627,7 @@
28626
28627
 
28627
28628
  // String.prototype.startsWith is not supported in IE11
28628
28629
  var startsWith = function startsWith(inputString, searchString, position) {
28629
- if (position === void 0) {
28630
+ if (position === undefined) {
28630
28631
  position = 0;
28631
28632
  }
28632
28633
  return inputString.slice(position, position + searchString.length) === searchString;
@@ -28967,9 +28968,9 @@
28967
28968
 
28968
28969
  var OutputFilter = /*#__PURE__*/function () {
28969
28970
  function OutputFilter(timelineController, trackName) {
28970
- this.timelineController = void 0;
28971
+ this.timelineController = undefined;
28971
28972
  this.cueRanges = [];
28972
- this.trackName = void 0;
28973
+ this.trackName = undefined;
28973
28974
  this.startTime = null;
28974
28975
  this.endTime = null;
28975
28976
  this.screen = null;
@@ -29001,19 +29002,19 @@
29001
29002
 
29002
29003
  var TimelineController = /*#__PURE__*/function () {
29003
29004
  function TimelineController(hls) {
29004
- this.hls = void 0;
29005
+ this.hls = undefined;
29005
29006
  this.media = null;
29006
- this.config = void 0;
29007
+ this.config = undefined;
29007
29008
  this.enabled = true;
29008
- this.Cues = void 0;
29009
+ this.Cues = undefined;
29009
29010
  this.textTracks = [];
29010
29011
  this.tracks = [];
29011
29012
  this.initPTS = [];
29012
29013
  this.unparsedVttFrags = [];
29013
29014
  this.captionsTracks = {};
29014
29015
  this.nonNativeCaptionsTracks = {};
29015
- this.cea608Parser1 = void 0;
29016
- this.cea608Parser2 = void 0;
29016
+ this.cea608Parser1 = undefined;
29017
+ this.cea608Parser2 = undefined;
29017
29018
  this.lastCc = -1;
29018
29019
  // Last video (CEA-608) fragment CC
29019
29020
  this.lastSn = -1;
@@ -29023,7 +29024,7 @@
29023
29024
  this.prevCC = -1;
29024
29025
  // Last subtitle fragment CC
29025
29026
  this.vttCCs = newVTTCCs();
29026
- this.captionsProperties = void 0;
29027
+ this.captionsProperties = undefined;
29027
29028
  this.hls = hls;
29028
29029
  this.config = hls.config;
29029
29030
  this.Cues = hls.config.cueHandler;
@@ -29369,7 +29370,7 @@
29369
29370
  };
29370
29371
  _proto.closedCaptionsForLevel = function closedCaptionsForLevel(frag) {
29371
29372
  var level = this.hls.levels[frag.level];
29372
- return level == null ? void 0 : level.attrs['CLOSED-CAPTIONS'];
29373
+ return level == null ? undefined : level.attrs['CLOSED-CAPTIONS'];
29373
29374
  };
29374
29375
  _proto.onFragLoading = function onFragLoading(event, data) {
29375
29376
  // if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack
@@ -29381,7 +29382,7 @@
29381
29382
  var _data$frag = data.frag,
29382
29383
  cc = _data$frag.cc,
29383
29384
  sn = _data$frag.sn;
29384
- var partIndex = (_data$part$index = (_data$part = data.part) == null ? void 0 : _data$part.index) != null ? _data$part$index : -1;
29385
+ var partIndex = (_data$part$index = (_data$part = data.part) == null ? undefined : _data$part.index) != null ? _data$part$index : -1;
29385
29386
  if (cea608Parser1 && cea608Parser2) {
29386
29387
  if (sn !== lastSn + 1 || sn === lastSn && partIndex !== this.lastPartIndex + 1 || cc !== this.lastCc) {
29387
29388
  cea608Parser1.reset();
@@ -29730,15 +29731,15 @@
29730
29731
  var BYTERANGE = /(\d+)-(\d+)\/(\d+)/;
29731
29732
  var FetchLoader = /*#__PURE__*/function () {
29732
29733
  function FetchLoader(config) {
29733
- this.fetchSetup = void 0;
29734
- this.requestTimeout = void 0;
29734
+ this.fetchSetup = undefined;
29735
+ this.requestTimeout = undefined;
29735
29736
  this.request = null;
29736
29737
  this.response = null;
29737
- this.controller = void 0;
29738
+ this.controller = undefined;
29738
29739
  this.context = null;
29739
29740
  this.config = null;
29740
29741
  this.callbacks = null;
29741
- this.stats = void 0;
29742
+ this.stats = undefined;
29742
29743
  this.loader = null;
29743
29744
  this.fetchSetup = config.fetchSetup || getRequest;
29744
29745
  this.controller = new self.AbortController();
@@ -29810,7 +29811,7 @@
29810
29811
  }
29811
29812
  stats.loading.first = first;
29812
29813
  stats.total = getContentLength(response.headers) || stats.total;
29813
- var onProgress = (_this$callbacks2 = _this.callbacks) == null ? void 0 : _this$callbacks2.onProgress;
29814
+ var onProgress = (_this$callbacks2 = _this.callbacks) == null ? undefined : _this$callbacks2.onProgress;
29814
29815
  if (onProgress && isFiniteNumber(config.highWaterMark)) {
29815
29816
  return _this.loadProgressively(response, stats, context, config.highWaterMark, onProgress);
29816
29817
  }
@@ -29838,11 +29839,11 @@
29838
29839
  data: responseData,
29839
29840
  code: response.status
29840
29841
  };
29841
- var onProgress = (_this$callbacks3 = _this.callbacks) == null ? void 0 : _this$callbacks3.onProgress;
29842
+ var onProgress = (_this$callbacks3 = _this.callbacks) == null ? undefined : _this$callbacks3.onProgress;
29842
29843
  if (onProgress && !isFiniteNumber(config.highWaterMark)) {
29843
29844
  onProgress(stats, context, responseData, response);
29844
29845
  }
29845
- (_this$callbacks4 = _this.callbacks) == null ? void 0 : _this$callbacks4.onSuccess(loaderResponse, stats, context, response);
29846
+ (_this$callbacks4 = _this.callbacks) == null ? undefined : _this$callbacks4.onSuccess(loaderResponse, stats, context, response);
29846
29847
  }).catch(function (error) {
29847
29848
  var _this$callbacks5;
29848
29849
  self.clearTimeout(_this.requestTimeout);
@@ -29853,7 +29854,7 @@
29853
29854
  // when destroying, 'error' itself can be undefined
29854
29855
  var code = !error ? 0 : error.code || 0;
29855
29856
  var text = !error ? null : error.message;
29856
- (_this$callbacks5 = _this.callbacks) == null ? void 0 : _this$callbacks5.onError({
29857
+ (_this$callbacks5 = _this.callbacks) == null ? undefined : _this$callbacks5.onError({
29857
29858
  code: code,
29858
29859
  text: text
29859
29860
  }, context, error ? error.details : null, stats);
@@ -29871,7 +29872,7 @@
29871
29872
  return this.response ? this.response.headers.get(name) : null;
29872
29873
  };
29873
29874
  _proto.loadProgressively = function loadProgressively(response, stats, context, highWaterMark, onProgress) {
29874
- if (highWaterMark === void 0) {
29875
+ if (highWaterMark === undefined) {
29875
29876
  highWaterMark = 0;
29876
29877
  }
29877
29878
  var chunkCache = new ChunkCache();
@@ -29949,8 +29950,8 @@
29949
29950
  function FetchError(message, code, details) {
29950
29951
  var _this2;
29951
29952
  _this2 = _Error.call(this, message) || this;
29952
- _this2.code = void 0;
29953
- _this2.details = void 0;
29953
+ _this2.code = undefined;
29954
+ _this2.details = undefined;
29954
29955
  _this2.code = code;
29955
29956
  _this2.details = details;
29956
29957
  return _this2;
@@ -29962,15 +29963,15 @@
29962
29963
  var AGE_HEADER_LINE_REGEX = /^age:\s*[\d.]+\s*$/im;
29963
29964
  var XhrLoader = /*#__PURE__*/function () {
29964
29965
  function XhrLoader(config) {
29965
- this.xhrSetup = void 0;
29966
- this.requestTimeout = void 0;
29967
- this.retryTimeout = void 0;
29968
- this.retryDelay = void 0;
29966
+ this.xhrSetup = undefined;
29967
+ this.requestTimeout = undefined;
29968
+ this.retryTimeout = undefined;
29969
+ this.retryDelay = undefined;
29969
29970
  this.config = null;
29970
29971
  this.callbacks = null;
29971
29972
  this.context = null;
29972
29973
  this.loader = null;
29973
- this.stats = void 0;
29974
+ this.stats = undefined;
29974
29975
  this.xhrSetup = config ? config.xhrSetup || null : null;
29975
29976
  this.stats = new LoadStats();
29976
29977
  this.retryDelay = 0;
@@ -30041,7 +30042,7 @@
30041
30042
  }).catch(function (error) {
30042
30043
  var _this$callbacks2;
30043
30044
  // IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS
30044
- (_this$callbacks2 = _this.callbacks) == null ? void 0 : _this$callbacks2.onError({
30045
+ (_this$callbacks2 = _this.callbacks) == null ? undefined : _this$callbacks2.onError({
30045
30046
  code: xhr.status,
30046
30047
  text: error.message
30047
30048
  }, context, xhr, stats);
@@ -30117,7 +30118,7 @@
30117
30118
  var len = xhr.responseType === 'arraybuffer' ? data.byteLength : data.length;
30118
30119
  stats.loaded = stats.total = len;
30119
30120
  stats.bwEstimate = stats.total * 8000 / (stats.loading.end - stats.loading.first);
30120
- var onProgress = (_this$callbacks3 = this.callbacks) == null ? void 0 : _this$callbacks3.onProgress;
30121
+ var onProgress = (_this$callbacks3 = this.callbacks) == null ? undefined : _this$callbacks3.onProgress;
30121
30122
  if (onProgress) {
30122
30123
  onProgress(stats, context, data, xhr);
30123
30124
  }
@@ -30126,7 +30127,7 @@
30126
30127
  data: data,
30127
30128
  code: _status
30128
30129
  };
30129
- (_this$callbacks4 = this.callbacks) == null ? void 0 : _this$callbacks4.onSuccess(_response, stats, context, xhr);
30130
+ (_this$callbacks4 = this.callbacks) == null ? undefined : _this$callbacks4.onSuccess(_response, stats, context, xhr);
30130
30131
  return;
30131
30132
  }
30132
30133
  }
@@ -30145,7 +30146,7 @@
30145
30146
  } else {
30146
30147
  var _this$callbacks5;
30147
30148
  logger.error(_status + " while loading " + context.url);
30148
- (_this$callbacks5 = this.callbacks) == null ? void 0 : _this$callbacks5.onError({
30149
+ (_this$callbacks5 = this.callbacks) == null ? undefined : _this$callbacks5.onError({
30149
30150
  code: _status,
30150
30151
  text: xhr.statusText
30151
30152
  }, context, xhr, stats);
@@ -30161,7 +30162,7 @@
30161
30162
  this.retry(retryConfig);
30162
30163
  } else {
30163
30164
  var _this$context;
30164
- logger.warn("timeout while loading " + ((_this$context = this.context) == null ? void 0 : _this$context.url));
30165
+ logger.warn("timeout while loading " + ((_this$context = this.context) == null ? undefined : _this$context.url));
30165
30166
  var callbacks = this.callbacks;
30166
30167
  if (callbacks) {
30167
30168
  this.abortInternal();
@@ -30174,7 +30175,7 @@
30174
30175
  stats = this.stats;
30175
30176
  this.retryDelay = getRetryDelay(retryConfig, stats.retry);
30176
30177
  stats.retry++;
30177
- logger.warn((status ? 'HTTP Status ' + status : 'Timeout') + " while loading " + (context == null ? void 0 : context.url) + ", retrying " + stats.retry + "/" + retryConfig.maxNumRetry + " in " + this.retryDelay + "ms");
30178
+ logger.warn((status ? 'HTTP Status ' + status : 'Timeout') + " while loading " + (context == null ? undefined : context.url) + ", retrying " + stats.retry + "/" + retryConfig.maxNumRetry + " in " + this.retryDelay + "ms");
30178
30179
  // abort and reset internal state
30179
30180
  this.abortInternal();
30180
30181
  this.loader = null;
@@ -30362,6 +30363,7 @@
30362
30363
  progressive: false,
30363
30364
  lowLatencyMode: true,
30364
30365
  cmcd: undefined,
30366
+ detectStallWithCurrentTimeMs: 1250,
30365
30367
  enableDateRangeMetadataCues: true,
30366
30368
  enableEmsgMetadataCues: true,
30367
30369
  enableEmsgKLVMetadata: false,
@@ -30653,7 +30655,7 @@
30653
30655
  var ID3TrackController = /*#__PURE__*/function () {
30654
30656
  function ID3TrackController(hls) {
30655
30657
  var _this = this;
30656
- this.hls = void 0;
30658
+ this.hls = undefined;
30657
30659
  this.id3Track = null;
30658
30660
  this.media = null;
30659
30661
  this.dateRangeCuesAppended = {};
@@ -30702,7 +30704,7 @@
30702
30704
  _proto.onMediaAttaching = function onMediaAttaching(event, data) {
30703
30705
  var _data$overrides;
30704
30706
  this.media = data.media;
30705
- if (((_data$overrides = data.overrides) == null ? void 0 : _data$overrides.cueRemoval) === false) {
30707
+ if (((_data$overrides = data.overrides) == null ? undefined : _data$overrides.cueRemoval) === false) {
30706
30708
  this.removeCues = false;
30707
30709
  }
30708
30710
  };
@@ -30802,7 +30804,7 @@
30802
30804
  };
30803
30805
  _proto.updateId3CueEnds = function updateId3CueEnds(startTime, type) {
30804
30806
  var _this$id3Track;
30805
- var cues = (_this$id3Track = this.id3Track) == null ? void 0 : _this$id3Track.cues;
30807
+ var cues = (_this$id3Track = this.id3Track) == null ? undefined : _this$id3Track.cues;
30806
30808
  if (cues) {
30807
30809
  for (var i = cues.length; i--;) {
30808
30810
  var cue = cues[i];
@@ -30890,7 +30892,7 @@
30890
30892
  }
30891
30893
  // Exit if the playlist does not have Date Ranges or does not have Program Date Time
30892
30894
  var lastFragment = details.fragments[details.fragments.length - 1];
30893
- if (ids.length === 0 || !isFiniteNumber(lastFragment == null ? void 0 : lastFragment.programDateTime)) {
30895
+ if (ids.length === 0 || !isFiniteNumber(lastFragment == null ? undefined : lastFragment.programDateTime)) {
30894
30896
  return;
30895
30897
  }
30896
30898
  if (!this.id3Track) {
@@ -30904,8 +30906,8 @@
30904
30906
 
30905
30907
  // Process DateRanges to determine end-time (known DURATION, END-DATE, or END-ON-NEXT)
30906
30908
  var appendedDateRangeCues = dateRangeCuesAppended[id];
30907
- var cues = (appendedDateRangeCues == null ? void 0 : appendedDateRangeCues.cues) || {};
30908
- var durationKnown = (appendedDateRangeCues == null ? void 0 : appendedDateRangeCues.durationKnown) || false;
30909
+ var cues = (appendedDateRangeCues == null ? undefined : appendedDateRangeCues.cues) || {};
30910
+ var durationKnown = (appendedDateRangeCues == null ? undefined : appendedDateRangeCues.durationKnown) || false;
30909
30911
  var endTime = MAX_CUE_ENDTIME;
30910
30912
  var duration = dateRange.duration,
30911
30913
  endDate = dateRange.endDate;
@@ -30984,8 +30986,8 @@
30984
30986
  var LatencyController = /*#__PURE__*/function () {
30985
30987
  function LatencyController(hls) {
30986
30988
  var _this = this;
30987
- this.hls = void 0;
30988
- this.config = void 0;
30989
+ this.hls = undefined;
30990
+ this.config = undefined;
30989
30991
  this.media = null;
30990
30992
  this.currentTime = 0;
30991
30993
  this.stallCount = 0;
@@ -31114,7 +31116,7 @@
31114
31116
  if (config.liveMaxLatencyDuration !== undefined) {
31115
31117
  return config.liveMaxLatencyDuration;
31116
31118
  }
31117
- var levelDetails = (_this$hls = this.hls) == null ? void 0 : _this$hls.latestLevelDetails;
31119
+ var levelDetails = (_this$hls = this.hls) == null ? undefined : _this$hls.latestLevelDetails;
31118
31120
  return levelDetails ? config.liveMaxLatencyDurationCount * levelDetails.targetduration : 0;
31119
31121
  }
31120
31122
  }, {
@@ -31202,12 +31204,12 @@
31202
31204
  _this._levels = [];
31203
31205
  _this._firstLevel = -1;
31204
31206
  _this._maxAutoLevel = -1;
31205
- _this._startLevel = void 0;
31207
+ _this._startLevel = undefined;
31206
31208
  _this.currentLevel = null;
31207
31209
  _this.currentLevelIndex = -1;
31208
31210
  _this.manualLevelIndex = -1;
31209
- _this.steering = void 0;
31210
- _this.onParsedComplete = void 0;
31211
+ _this.steering = undefined;
31212
+ _this.onParsedComplete = undefined;
31211
31213
  _this.steering = contentSteeringController;
31212
31214
  _this._registerListeners();
31213
31215
  return _this;
@@ -31277,7 +31279,7 @@
31277
31279
  // Returns empty and set to undefined for 'mp4a.40.34' with fallback to 'audio/mpeg' SourceBuffer
31278
31280
  levelParsed.audioCodec = audioCodec = getCodecCompatibleName(audioCodec, preferManagedMediaSource) || undefined;
31279
31281
  }
31280
- if (((_videoCodec = videoCodec) == null ? void 0 : _videoCodec.indexOf('avc1')) === 0) {
31282
+ if (((_videoCodec = videoCodec) == null ? undefined : _videoCodec.indexOf('avc1')) === 0) {
31281
31283
  videoCodec = levelParsed.videoCodec = convertAVC1ToAVCOTI(videoCodec);
31282
31284
  }
31283
31285
 
@@ -31448,7 +31450,7 @@
31448
31450
  var bandwidthEstimate = this.hls.bandwidthEstimate;
31449
31451
  this.log("manifest loaded, " + levels.length + " level(s) found, first bitrate: " + firstLevelBitrate);
31450
31452
  // Update default bwe to first variant bitrate as long it has not been configured or set
31451
- if (((_this$hls$userConfig = this.hls.userConfig) == null ? void 0 : _this$hls$userConfig.abrEwmaDefaultEstimate) === undefined) {
31453
+ if (((_this$hls$userConfig = this.hls.userConfig) == null ? undefined : _this$hls$userConfig.abrEwmaDefaultEstimate) === undefined) {
31452
31454
  var startingBwEstimate = Math.min(firstLevelBitrate, this.hls.config.abrEwmaDefaultEstimateMax);
31453
31455
  if (startingBwEstimate > bandwidthEstimate && bandwidthEstimate === this.hls.abrEwmaDefaultEstimate) {
31454
31456
  this.hls.bandwidthEstimate = startingBwEstimate;
@@ -31547,8 +31549,8 @@
31547
31549
  var currentLevelIndex = this.currentLevelIndex;
31548
31550
  var pathwayId = currentLevel.attrs['PATHWAY-ID'];
31549
31551
  var details = currentLevel.details;
31550
- var age = details == null ? void 0 : details.age;
31551
- 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);
31552
+ var age = details == null ? undefined : details.age;
31553
+ 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);
31552
31554
  this.hls.trigger(Events.LEVEL_LOADING, {
31553
31555
  url: url,
31554
31556
  level: currentLevelIndex,
@@ -31698,7 +31700,7 @@
31698
31700
  var levelDetails = level.details;
31699
31701
  if (!levelDetails || levelDetails.live) {
31700
31702
  // level not retrieved yet, or live playlist we need to (re)load it
31701
- var hlsUrlParameters = this.switchParams(level.uri, lastLevel == null ? void 0 : lastLevel.details, levelDetails);
31703
+ var hlsUrlParameters = this.switchParams(level.uri, lastLevel == null ? undefined : lastLevel.details, levelDetails);
31702
31704
  this.loadPlaylist(hlsUrlParameters);
31703
31705
  }
31704
31706
  }
@@ -31787,25 +31789,23 @@
31787
31789
  });
31788
31790
  }
31789
31791
 
31790
- var STALL_MINIMUM_DURATION_MS = 250;
31791
31792
  var MAX_START_GAP_JUMP = 2.0;
31792
31793
  var SKIP_BUFFER_HOLE_STEP_SECONDS = 0.1;
31793
31794
  var SKIP_BUFFER_RANGE_START = 0.05;
31794
31795
  var GapController = /*#__PURE__*/function (_Logger) {
31795
- function GapController(config, media, fragmentTracker, hls) {
31796
+ function GapController(media, fragmentTracker, hls) {
31796
31797
  var _this;
31797
31798
  _this = _Logger.call(this, 'gap-controller', hls.logger) || this;
31798
- _this.config = void 0;
31799
31799
  _this.media = null;
31800
- _this.fragmentTracker = void 0;
31801
- _this.hls = void 0;
31800
+ _this.fragmentTracker = null;
31801
+ _this.hls = null;
31802
31802
  _this.nudgeRetry = 0;
31803
31803
  _this.stallReported = false;
31804
31804
  _this.stalled = null;
31805
31805
  _this.moved = false;
31806
31806
  _this.seeking = false;
31807
31807
  _this.ended = 0;
31808
- _this.config = config;
31808
+ _this.waiting = 0;
31809
31809
  _this.media = media;
31810
31810
  _this.fragmentTracker = fragmentTracker;
31811
31811
  _this.hls = hls;
@@ -31814,9 +31814,7 @@
31814
31814
  _inheritsLoose(GapController, _Logger);
31815
31815
  var _proto = GapController.prototype;
31816
31816
  _proto.destroy = function destroy() {
31817
- this.media = null;
31818
- // @ts-ignore
31819
- this.hls = this.fragmentTracker = null;
31817
+ this.media = this.hls = this.fragmentTracker = null;
31820
31818
  }
31821
31819
 
31822
31820
  /**
@@ -31826,10 +31824,10 @@
31826
31824
  * @param lastCurrentTime - Previously read playhead position
31827
31825
  */;
31828
31826
  _proto.poll = function poll(lastCurrentTime, activeFrag, levelDetails, state) {
31829
- var config = this.config,
31830
- media = this.media,
31827
+ var _this$hls;
31828
+ var media = this.media,
31831
31829
  stalled = this.stalled;
31832
- if (media === null) {
31830
+ if (!media) {
31833
31831
  return;
31834
31832
  }
31835
31833
  var currentTime = media.currentTime,
@@ -31847,43 +31845,45 @@
31847
31845
  if (!seeking) {
31848
31846
  this.nudgeRetry = 0;
31849
31847
  }
31850
- if (stalled !== null) {
31851
- // The playhead is now moving, but was previously stalled
31852
- if (this.stallReported) {
31853
- var _stalledDuration = self.performance.now() - stalled;
31854
- this.warn("playback not stuck anymore @" + currentTime + ", after " + Math.round(_stalledDuration) + "ms");
31855
- this.stallReported = false;
31856
- }
31857
- this.stalled = null;
31848
+ if (this.waiting === 0) {
31849
+ this.stallResolved(currentTime);
31858
31850
  }
31859
31851
  return;
31860
31852
  }
31861
31853
 
31862
31854
  // Clear stalled state when beginning or finishing seeking so that we don't report stalls coming out of a seek
31863
31855
  if (beginSeek || seeked) {
31864
- this.stalled = null;
31856
+ if (seeked) {
31857
+ this.stallResolved(currentTime);
31858
+ }
31865
31859
  return;
31866
31860
  }
31867
31861
 
31868
31862
  // The playhead should not be moving
31869
- if (media.paused && !seeking || media.ended || media.playbackRate === 0 || !BufferHelper.getBuffered(media).length) {
31863
+ if (media.paused && !seeking || media.ended || media.playbackRate === 0) {
31864
+ this.nudgeRetry = 0;
31865
+ this.stallResolved(currentTime);
31870
31866
  // Fire MEDIA_ENDED to workaround event not being dispatched by browser
31871
- if (!this.ended && media.ended) {
31867
+ if (!this.ended && media.ended && this.hls) {
31872
31868
  this.ended = currentTime || 1;
31873
31869
  this.hls.trigger(Events.MEDIA_ENDED, {
31874
31870
  stalled: false
31875
31871
  });
31876
31872
  }
31873
+ return;
31874
+ }
31875
+ if (!BufferHelper.getBuffered(media).length) {
31877
31876
  this.nudgeRetry = 0;
31878
31877
  return;
31879
31878
  }
31880
31879
  var bufferInfo = BufferHelper.bufferInfo(media, currentTime, 0);
31881
31880
  var nextStart = bufferInfo.nextStart || 0;
31882
- if (seeking) {
31881
+ var fragmentTracker = this.fragmentTracker;
31882
+ if (seeking && fragmentTracker) {
31883
31883
  // Waiting for seeking in a buffered range to complete
31884
31884
  var hasEnoughBuffer = bufferInfo.len > MAX_START_GAP_JUMP;
31885
31885
  // Next buffered range is too far ahead to jump to while still seeking
31886
- var noBufferGap = !nextStart || activeFrag && activeFrag.start <= currentTime || nextStart - currentTime > MAX_START_GAP_JUMP && !this.fragmentTracker.getPartialFragment(currentTime);
31886
+ var noBufferGap = !nextStart || activeFrag && activeFrag.start <= currentTime || nextStart - currentTime > MAX_START_GAP_JUMP && !fragmentTracker.getPartialFragment(currentTime);
31887
31887
  if (hasEnoughBuffer || noBufferGap) {
31888
31888
  return;
31889
31889
  }
@@ -31893,7 +31893,7 @@
31893
31893
 
31894
31894
  // Skip start gaps if we haven't played, but the last poll detected the start of a stall
31895
31895
  // The addition poll gives the browser a chance to jump the gap for us
31896
- if (!this.moved && this.stalled !== null) {
31896
+ if (!this.moved && this.stalled !== null && fragmentTracker) {
31897
31897
  // There is no playable buffer (seeked, waiting for buffer)
31898
31898
  var isBuffered = bufferInfo.len > 0;
31899
31899
  if (!isBuffered && !nextStart) {
@@ -31907,7 +31907,7 @@
31907
31907
  // that begins over 1 target duration after the video start position.
31908
31908
  var isLive = !!(levelDetails != null && levelDetails.live);
31909
31909
  var maxStartGapJump = isLive ? levelDetails.targetduration * 2 : MAX_START_GAP_JUMP;
31910
- var partialOrGap = this.fragmentTracker.getPartialFragment(currentTime);
31910
+ var partialOrGap = fragmentTracker.getPartialFragment(currentTime);
31911
31911
  if (startJump > 0 && (startJump <= maxStartGapJump || partialOrGap)) {
31912
31912
  if (!media.paused) {
31913
31913
  this._trySkipBufferHole(partialOrGap);
@@ -31917,16 +31917,27 @@
31917
31917
  }
31918
31918
 
31919
31919
  // Start tracking stall time
31920
+ var config = (_this$hls = this.hls) == null ? undefined : _this$hls.config;
31921
+ if (!config) {
31922
+ return;
31923
+ }
31924
+ var detectStallWithCurrentTimeMs = config.detectStallWithCurrentTimeMs;
31920
31925
  var tnow = self.performance.now();
31926
+ var tWaiting = this.waiting;
31921
31927
  if (stalled === null) {
31922
- this.stalled = tnow;
31928
+ // Use time of recent "waiting" event
31929
+ if (tWaiting > 0 && tnow - tWaiting < detectStallWithCurrentTimeMs) {
31930
+ this.stalled = tWaiting;
31931
+ } else {
31932
+ this.stalled = tnow;
31933
+ }
31923
31934
  return;
31924
31935
  }
31925
31936
  var stalledDuration = tnow - stalled;
31926
- if (!seeking && stalledDuration >= STALL_MINIMUM_DURATION_MS) {
31937
+ if (!seeking && (stalledDuration >= detectStallWithCurrentTimeMs || tWaiting) && this.hls) {
31927
31938
  // Dispatch MEDIA_ENDED when media.ended/ended event is not signalled at end of stream
31928
- if (state === State.ENDED && !(levelDetails != null && levelDetails.live) && Math.abs(currentTime - ((levelDetails == null ? void 0 : levelDetails.edge) || 0)) < 1) {
31929
- if (stalledDuration < 1000 || this.ended) {
31939
+ if (state === State.ENDED && !(levelDetails != null && levelDetails.live) && Math.abs(currentTime - ((levelDetails == null ? undefined : levelDetails.edge) || 0)) < 1) {
31940
+ if (this.ended) {
31930
31941
  return;
31931
31942
  }
31932
31943
  this.ended = currentTime || 1;
@@ -31937,12 +31948,26 @@
31937
31948
  }
31938
31949
  // Report stalling after trying to fix
31939
31950
  this._reportStall(bufferInfo);
31940
- if (!this.media) {
31951
+ if (!this.media || !this.hls) {
31941
31952
  return;
31942
31953
  }
31943
31954
  }
31944
31955
  var bufferedWithHoles = BufferHelper.bufferInfo(media, currentTime, config.maxBufferHole);
31945
31956
  this._tryFixBufferStall(bufferedWithHoles, stalledDuration);
31957
+ };
31958
+ _proto.stallResolved = function stallResolved(currentTime) {
31959
+ var stalled = this.stalled;
31960
+ if (stalled && this.hls) {
31961
+ this.stalled = null;
31962
+ // The playhead is now moving, but was previously stalled
31963
+ if (this.stallReported) {
31964
+ var stalledDuration = self.performance.now() - stalled;
31965
+ this.warn("playback not stuck anymore @" + currentTime + ", after " + Math.round(stalledDuration) + "ms");
31966
+ this.stallReported = false;
31967
+ this.waiting = 0;
31968
+ this.hls.trigger(Events.STALL_RESOLVED, {});
31969
+ }
31970
+ }
31946
31971
  }
31947
31972
 
31948
31973
  /**
@@ -31952,10 +31977,11 @@
31952
31977
  * @private
31953
31978
  */;
31954
31979
  _proto._tryFixBufferStall = function _tryFixBufferStall(bufferInfo, stalledDurationMs) {
31955
- var config = this.config,
31956
- fragmentTracker = this.fragmentTracker,
31980
+ var _this$hls2;
31981
+ var fragmentTracker = this.fragmentTracker,
31957
31982
  media = this.media;
31958
- if (media === null) {
31983
+ var config = (_this$hls2 = this.hls) == null ? undefined : _this$hls2.config;
31984
+ if (!media || !fragmentTracker || !config) {
31959
31985
  return;
31960
31986
  }
31961
31987
  var currentTime = media.currentTime;
@@ -31975,13 +32001,12 @@
31975
32001
  // we may just have to "nudge" the playlist as the browser decoding/rendering engine
31976
32002
  // needs to cross some sort of threshold covering all source-buffers content
31977
32003
  // to start playing properly.
31978
- if ((bufferInfo.len > config.maxBufferHole || bufferInfo.nextStart && bufferInfo.nextStart - currentTime < config.maxBufferHole) && stalledDurationMs > config.highBufferWatchdogPeriod * 1000) {
32004
+ var bufferedRanges = bufferInfo.buffered;
32005
+ if ((bufferedRanges && bufferedRanges.length > 1 && bufferInfo.len > config.maxBufferHole || bufferInfo.nextStart && bufferInfo.nextStart - currentTime < config.maxBufferHole) && stalledDurationMs > config.highBufferWatchdogPeriod * 1000) {
31979
32006
  this.warn('Trying to nudge playhead over buffer-hole');
31980
32007
  // Try to nudge currentTime over a buffer hole if we've been stalling for the configured amount of seconds
31981
32008
  // We only try to jump the hole if it's under the configured size
31982
- // Reset stalled so to rearm watchdog timer
31983
- this.stalled = null;
31984
- this._tryNudgeBuffer();
32009
+ this._tryNudgeBuffer(bufferInfo);
31985
32010
  }
31986
32011
  }
31987
32012
 
@@ -31993,8 +32018,9 @@
31993
32018
  _proto._reportStall = function _reportStall(bufferInfo) {
31994
32019
  var hls = this.hls,
31995
32020
  media = this.media,
31996
- stallReported = this.stallReported;
31997
- if (!stallReported && media) {
32021
+ stallReported = this.stallReported,
32022
+ stalled = this.stalled;
32023
+ if (!stallReported && stalled !== null && media && hls) {
31998
32024
  // Report stalled error once
31999
32025
  this.stallReported = true;
32000
32026
  var error = new Error("Playback stalling at @" + media.currentTime + " due to low buffer (" + JSON.stringify(bufferInfo) + ")");
@@ -32004,7 +32030,11 @@
32004
32030
  details: ErrorDetails.BUFFER_STALLED_ERROR,
32005
32031
  fatal: false,
32006
32032
  error: error,
32007
- buffer: bufferInfo.len
32033
+ buffer: bufferInfo.len,
32034
+ bufferInfo: bufferInfo,
32035
+ stalled: {
32036
+ start: stalled
32037
+ }
32008
32038
  });
32009
32039
  }
32010
32040
  }
@@ -32015,10 +32045,11 @@
32015
32045
  * @private
32016
32046
  */;
32017
32047
  _proto._trySkipBufferHole = function _trySkipBufferHole(partial) {
32018
- var config = this.config,
32019
- hls = this.hls,
32048
+ var _this$hls3;
32049
+ var fragmentTracker = this.fragmentTracker,
32020
32050
  media = this.media;
32021
- if (media === null) {
32051
+ var config = (_this$hls3 = this.hls) == null ? undefined : _this$hls3.config;
32052
+ if (!media || !fragmentTracker || !config) {
32022
32053
  return 0;
32023
32054
  }
32024
32055
 
@@ -32033,7 +32064,6 @@
32033
32064
  if (gapLength > 0 && (bufferStarved || waiting)) {
32034
32065
  // Only allow large gaps to be skipped if it is a start gap, or all fragments in skip range are partial
32035
32066
  if (gapLength > config.maxBufferHole) {
32036
- var fragmentTracker = this.fragmentTracker;
32037
32067
  var startGap = false;
32038
32068
  if (currentTime === 0) {
32039
32069
  var startFrag = fragmentTracker.getAppendedFrag(0, PlaylistLevelType.MAIN);
@@ -32064,17 +32094,18 @@
32064
32094
  var targetTime = Math.max(startTime + SKIP_BUFFER_RANGE_START, currentTime + SKIP_BUFFER_HOLE_STEP_SECONDS);
32065
32095
  this.warn("skipping hole, adjusting currentTime from " + currentTime + " to " + targetTime);
32066
32096
  this.moved = true;
32067
- this.stalled = null;
32068
32097
  media.currentTime = targetTime;
32069
- if (partial && !partial.gap) {
32098
+ if (partial && !partial.gap && this.hls) {
32070
32099
  var error = new Error("fragment loaded with buffer holes, seeking from " + currentTime + " to " + targetTime);
32071
- hls.trigger(Events.ERROR, {
32100
+ this.hls.trigger(Events.ERROR, {
32072
32101
  type: ErrorTypes.MEDIA_ERROR,
32073
32102
  details: ErrorDetails.BUFFER_SEEK_OVER_HOLE,
32074
32103
  fatal: false,
32075
32104
  error: error,
32076
32105
  reason: error.message,
32077
- frag: partial
32106
+ frag: partial,
32107
+ buffer: bufferInfo.len,
32108
+ bufferInfo: bufferInfo
32078
32109
  });
32079
32110
  }
32080
32111
  return targetTime;
@@ -32087,13 +32118,13 @@
32087
32118
  * Attempts to fix buffer stalls by advancing the mediaElement's current time by a small amount.
32088
32119
  * @private
32089
32120
  */;
32090
- _proto._tryNudgeBuffer = function _tryNudgeBuffer() {
32091
- var config = this.config,
32092
- hls = this.hls,
32121
+ _proto._tryNudgeBuffer = function _tryNudgeBuffer(bufferInfo) {
32122
+ var hls = this.hls,
32093
32123
  media = this.media,
32094
32124
  nudgeRetry = this.nudgeRetry;
32095
- if (media === null) {
32096
- return;
32125
+ var config = hls == null ? undefined : hls.config;
32126
+ if (!media || !config) {
32127
+ return 0;
32097
32128
  }
32098
32129
  var currentTime = media.currentTime;
32099
32130
  this.nudgeRetry++;
@@ -32107,7 +32138,9 @@
32107
32138
  type: ErrorTypes.MEDIA_ERROR,
32108
32139
  details: ErrorDetails.BUFFER_NUDGE_ON_STALL,
32109
32140
  error: error,
32110
- fatal: false
32141
+ fatal: false,
32142
+ buffer: bufferInfo.len,
32143
+ bufferInfo: bufferInfo
32111
32144
  });
32112
32145
  } else {
32113
32146
  var _error = new Error("Playhead still not moving while enough data buffered @" + currentTime + " after " + config.nudgeMaxRetry + " nudges");
@@ -32116,7 +32149,9 @@
32116
32149
  type: ErrorTypes.MEDIA_ERROR,
32117
32150
  details: ErrorDetails.BUFFER_STALLED_ERROR,
32118
32151
  error: _error,
32119
- fatal: true
32152
+ fatal: true,
32153
+ buffer: bufferInfo.len,
32154
+ bufferInfo: bufferInfo
32120
32155
  });
32121
32156
  }
32122
32157
  };
@@ -32142,7 +32177,7 @@
32142
32177
  return false;
32143
32178
  }
32144
32179
  var mediaSource = getMediaSource();
32145
- return typeof (mediaSource == null ? void 0 : mediaSource.isTypeSupported) === 'function' && (['avc1.42E01E,mp4a.40.2', 'av01.0.01M.08', 'vp09.00.50.08'].some(function (codecsForVideoContainer) {
32180
+ return typeof (mediaSource == null ? undefined : mediaSource.isTypeSupported) === 'function' && (['avc1.42E01E,mp4a.40.2', 'av01.0.01M.08', 'vp09.00.50.08'].some(function (codecsForVideoContainer) {
32146
32181
  return mediaSource.isTypeSupported(mimeTypeForCodec(codecsForVideoContainer, 'video'));
32147
32182
  }) || ['mp4a.40.2', 'fLaC'].some(function (codecForAudioContainer) {
32148
32183
  return mediaSource.isTypeSupported(mimeTypeForCodec(codecForAudioContainer, 'audio'));
@@ -32151,7 +32186,7 @@
32151
32186
  function changeTypeSupported() {
32152
32187
  var _sourceBuffer$prototy;
32153
32188
  var sourceBuffer = getSourceBuffer();
32154
- return typeof (sourceBuffer == null ? void 0 : (_sourceBuffer$prototy = sourceBuffer.prototype) == null ? void 0 : _sourceBuffer$prototy.changeType) === 'function';
32189
+ return typeof (sourceBuffer == null ? undefined : (_sourceBuffer$prototy = sourceBuffer.prototype) == null ? undefined : _sourceBuffer$prototy.changeType) === 'function';
32155
32190
  }
32156
32191
 
32157
32192
  var TICK_INTERVAL = 100; // how often to tick in ms
@@ -32172,11 +32207,18 @@
32172
32207
  _this.backtrackFragment = null;
32173
32208
  _this.audioCodecSwitch = false;
32174
32209
  _this.videoBuffer = null;
32210
+ _this.onMediaWaiting = function () {
32211
+ var gapController = _this.gapController;
32212
+ if (gapController) {
32213
+ gapController.waiting = self.performance.now();
32214
+ }
32215
+ };
32175
32216
  _this.onMediaPlaying = function () {
32176
32217
  // tick to speed up FRAG_CHANGED triggering
32177
32218
  var gapController = _this.gapController;
32178
32219
  if (gapController) {
32179
32220
  gapController.ended = 0;
32221
+ gapController.waiting = 0;
32180
32222
  }
32181
32223
  _this.tick();
32182
32224
  };
@@ -32231,7 +32273,7 @@
32231
32273
  };
32232
32274
  _proto.onHandlerDestroying = function onHandlerDestroying() {
32233
32275
  // @ts-ignore
32234
- this.onMediaPlaying = this.onMediaSeeked = null;
32276
+ this.onMediaPlaying = this.onMediaSeeked = this.onMediaWaiting = null;
32235
32277
  this.unregisterListeners();
32236
32278
  _BaseStreamController.prototype.onHandlerDestroying.call(this);
32237
32279
  };
@@ -32284,8 +32326,8 @@
32284
32326
  {
32285
32327
  var levels = this.levels,
32286
32328
  level = this.level;
32287
- var currentLevel = levels == null ? void 0 : levels[level];
32288
- var details = currentLevel == null ? void 0 : currentLevel.details;
32329
+ var currentLevel = levels == null ? undefined : levels[level];
32330
+ var details = currentLevel == null ? undefined : currentLevel.details;
32289
32331
  if (details && (!details.live || this.levelLastLoaded === currentLevel && !this.waitForLive(currentLevel))) {
32290
32332
  if (this.waitForCdnTuneIn(details)) {
32291
32333
  break;
@@ -32307,7 +32349,7 @@
32307
32349
  if (!retryDate || now >= retryDate || (_this$media = this.media) != null && _this$media.seeking) {
32308
32350
  var _levels = this.levels,
32309
32351
  _level = this.level;
32310
- var _currentLevel = _levels == null ? void 0 : _levels[_level];
32352
+ var _currentLevel = _levels == null ? undefined : _levels[_level];
32311
32353
  this.resetStartWhenNotLoaded(_currentLevel || null);
32312
32354
  this.state = State.IDLE;
32313
32355
  }
@@ -32552,15 +32594,18 @@
32552
32594
  var media = data.media;
32553
32595
  media.removeEventListener('playing', this.onMediaPlaying);
32554
32596
  media.removeEventListener('seeked', this.onMediaSeeked);
32597
+ media.removeEventListener('waiting', this.onMediaWaiting);
32555
32598
  media.addEventListener('playing', this.onMediaPlaying);
32556
32599
  media.addEventListener('seeked', this.onMediaSeeked);
32557
- this.gapController = new GapController(this.config, media, this.fragmentTracker, this.hls);
32600
+ media.addEventListener('waiting', this.onMediaWaiting);
32601
+ this.gapController = new GapController(media, this.fragmentTracker, this.hls);
32558
32602
  };
32559
32603
  _proto.onMediaDetaching = function onMediaDetaching(event, data) {
32560
32604
  var media = this.media;
32561
32605
  if (media) {
32562
32606
  media.removeEventListener('playing', this.onMediaPlaying);
32563
32607
  media.removeEventListener('seeked', this.onMediaSeeked);
32608
+ media.removeEventListener('waiting', this.onMediaWaiting);
32564
32609
  }
32565
32610
  this.videoBuffer = null;
32566
32611
  this.fragPlaying = null;
@@ -32582,7 +32627,7 @@
32582
32627
  if (gapController.ended) {
32583
32628
  return;
32584
32629
  }
32585
- gapController.ended = ((_this$media2 = this.media) == null ? void 0 : _this$media2.currentTime) || 1;
32630
+ gapController.ended = ((_this$media2 = this.media) == null ? undefined : _this$media2.currentTime) || 1;
32586
32631
  }
32587
32632
  this.hls.trigger(Events.MEDIA_ENDED, {
32588
32633
  stalled: false
@@ -32653,7 +32698,7 @@
32653
32698
  if (newDetails.deltaUpdateFailed) {
32654
32699
  return;
32655
32700
  }
32656
- sliding = this.alignPlaylists(newDetails, curLevel.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ? void 0 : _this$levelLastLoaded.details);
32701
+ sliding = this.alignPlaylists(newDetails, curLevel.details, (_this$levelLastLoaded = this.levelLastLoaded) == null ? undefined : _this$levelLastLoaded.details);
32657
32702
  }
32658
32703
  // override level info
32659
32704
  curLevel.details = newDetails;
@@ -32733,7 +32778,7 @@
32733
32778
 
32734
32779
  // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)
32735
32780
  var accurateTimeOffset = details.PTSKnown || !details.live;
32736
- var initSegmentData = (_frag$initSegment = frag.initSegment) == null ? void 0 : _frag$initSegment.data;
32781
+ var initSegmentData = (_frag$initSegment = frag.initSegment) == null ? undefined : _frag$initSegment.data;
32737
32782
  var audioCodec = this._getAudioCodec(currentLevel);
32738
32783
 
32739
32784
  // transmux the MPEG-TS data to ISO-BMFF segments
@@ -32778,7 +32823,7 @@
32778
32823
  this.fragmentTracker.removeAllFragments();
32779
32824
  hls.once(Events.BUFFER_FLUSHED, function () {
32780
32825
  var _this2$hls;
32781
- (_this2$hls = _this2.hls) == null ? void 0 : _this2$hls.trigger(Events.AUDIO_TRACK_SWITCHED, data);
32826
+ (_this2$hls = _this2.hls) == null ? undefined : _this2$hls.trigger(Events.AUDIO_TRACK_SWITCHED, data);
32782
32827
  });
32783
32828
  hls.trigger(Events.BUFFER_FLUSHING, {
32784
32829
  startOffset: 0,
@@ -32886,7 +32931,7 @@
32886
32931
  case ErrorDetails.LEVEL_LOAD_TIMEOUT:
32887
32932
  case ErrorDetails.LEVEL_PARSING_ERROR:
32888
32933
  // in case of non fatal error while loading level, if level controller is not retrying to load level, switch back to IDLE
32889
- if (!data.levelRetry && this.state === State.WAITING_LEVEL && ((_data$context = data.context) == null ? void 0 : _data$context.type) === PlaylistContextType.LEVEL) {
32934
+ if (!data.levelRetry && this.state === State.WAITING_LEVEL && ((_data$context = data.context) == null ? undefined : _data$context.type) === PlaylistContextType.LEVEL) {
32890
32935
  this.state = State.IDLE;
32891
32936
  }
32892
32937
  break;
@@ -32970,7 +33015,7 @@
32970
33015
  var startPosition = this.startPosition;
32971
33016
  // only adjust currentTime if different from startPosition or if startPosition not buffered
32972
33017
  // at that stage, there should be only one buffered range, as we reach that code after first fragment has been buffered
32973
- if (startPosition >= 0) {
33018
+ if (startPosition >= 0 && currentTime < startPosition) {
32974
33019
  if (media.seeking) {
32975
33020
  this.log("could not seek to " + startPosition + ", already seeking at " + currentTime);
32976
33021
  return;
@@ -32980,13 +33025,13 @@
32980
33025
  var details = this.getLevelDetails();
32981
33026
  var configuredTimelineOffset = this.config.timelineOffset;
32982
33027
  if (configuredTimelineOffset && startPosition) {
32983
- startPosition += (details == null ? void 0 : details.appliedTimelineOffset) || configuredTimelineOffset;
33028
+ startPosition += (details == null ? undefined : details.appliedTimelineOffset) || configuredTimelineOffset;
32984
33029
  }
32985
33030
  var buffered = BufferHelper.getBuffered(media);
32986
33031
  var bufferStart = buffered.length ? buffered.start(0) : 0;
32987
33032
  var delta = bufferStart - startPosition;
32988
33033
  var skipTolerance = Math.max(this.config.maxBufferHole, this.config.maxFragLookUpTolerance);
32989
- if (delta > 0 && (delta < skipTolerance || this.loadingParts && delta < 2 * ((details == null ? void 0 : details.partTarget) || 0))) {
33034
+ if (delta > 0 && (delta < skipTolerance || this.loadingParts && delta < 2 * ((details == null ? undefined : details.partTarget) || 0))) {
32990
33035
  this.log("adjusting start position by " + delta + " to match buffer start");
32991
33036
  startPosition += delta;
32992
33037
  this.startPosition = startPosition;
@@ -33014,7 +33059,7 @@
33014
33059
  fragment.bitrateTest = true;
33015
33060
  this._doFragLoad(fragment, level).then(function (data) {
33016
33061
  var hls = _this3.hls;
33017
- var frag = data == null ? void 0 : data.frag;
33062
+ var frag = data == null ? undefined : data.frag;
33018
33063
  if (!frag || _this3.fragContextChanged(frag)) {
33019
33064
  return;
33020
33065
  }
@@ -33233,7 +33278,7 @@
33233
33278
  video.levelCodec = currentLevel.videoCodec;
33234
33279
  video.id = 'main';
33235
33280
  var parsedVideoCodec = video.codec;
33236
- if ((parsedVideoCodec == null ? void 0 : parsedVideoCodec.length) === 4) {
33281
+ if ((parsedVideoCodec == null ? undefined : parsedVideoCodec.length) === 4) {
33237
33282
  // Make up for passthrough-remuxer not being able to parse full codec
33238
33283
  // (logger warning "Unhandled video codec...")
33239
33284
  switch (parsedVideoCodec) {
@@ -33347,7 +33392,7 @@
33347
33392
  get: function get() {
33348
33393
  var levels = this.levels,
33349
33394
  level = this.level;
33350
- var levelInfo = levels == null ? void 0 : levels[level];
33395
+ var levelInfo = levels == null ? undefined : levels[level];
33351
33396
  if (!levelInfo) {
33352
33397
  return this.config.maxBufferLength;
33353
33398
  }
@@ -33369,7 +33414,7 @@
33369
33414
  if (this.fragPlaying) {
33370
33415
  return this.fragPlaying;
33371
33416
  }
33372
- var currentTime = ((_this$media3 = this.media) == null ? void 0 : _this$media3.currentTime) || this.lastCurrentTime;
33417
+ var currentTime = ((_this$media3 = this.media) == null ? undefined : _this$media3.currentTime) || this.lastCurrentTime;
33373
33418
  if (isFiniteNumber(currentTime)) {
33374
33419
  return this.getAppendedFrag(currentTime);
33375
33420
  }
@@ -33379,7 +33424,7 @@
33379
33424
  key: "currentProgramDateTime",
33380
33425
  get: function get() {
33381
33426
  var _this$media4;
33382
- var currentTime = ((_this$media4 = this.media) == null ? void 0 : _this$media4.currentTime) || this.lastCurrentTime;
33427
+ var currentTime = ((_this$media4 = this.media) == null ? undefined : _this$media4.currentTime) || this.lastCurrentTime;
33383
33428
  if (isFiniteNumber(currentTime)) {
33384
33429
  var details = this.getLevelDetails();
33385
33430
  var frag = this.currentFrag || (details ? findFragmentByPTS(null, details.fragments, currentTime) : null);
@@ -33421,7 +33466,7 @@
33421
33466
 
33422
33467
  var KeyLoader = /*#__PURE__*/function () {
33423
33468
  function KeyLoader(config) {
33424
- this.config = void 0;
33469
+ this.config = undefined;
33425
33470
  this.keyUriToKeyInfo = {};
33426
33471
  this.emeController = null;
33427
33472
  this.config = config;
@@ -33432,7 +33477,7 @@
33432
33477
  var loader = this.keyUriToKeyInfo[uri].loader;
33433
33478
  if (loader) {
33434
33479
  var _loader$context;
33435
- if (type && type !== ((_loader$context = loader.context) == null ? void 0 : _loader$context.frag.type)) {
33480
+ if (type && type !== ((_loader$context = loader.context) == null ? undefined : _loader$context.frag.type)) {
33436
33481
  return;
33437
33482
  }
33438
33483
  loader.abort();
@@ -33459,7 +33504,7 @@
33459
33504
  this.keyUriToKeyInfo = {};
33460
33505
  };
33461
33506
  _proto.createKeyLoadError = function createKeyLoadError(frag, details, error, networkDetails, response) {
33462
- if (details === void 0) {
33507
+ if (details === undefined) {
33463
33508
  details = ErrorDetails.KEY_LOAD_ERROR;
33464
33509
  }
33465
33510
  return new LoadError({
@@ -33527,7 +33572,7 @@
33527
33572
  // Return key load promise as long as it does not have a mediakey session with an unusable key status
33528
33573
  if ((_keyInfo2 = keyInfo) != null && _keyInfo2.keyLoadPromise) {
33529
33574
  var _keyInfo$mediaKeySess;
33530
- switch ((_keyInfo$mediaKeySess = keyInfo.mediaKeySessionContext) == null ? void 0 : _keyInfo$mediaKeySess.keyStatus) {
33575
+ switch ((_keyInfo$mediaKeySess = keyInfo.mediaKeySessionContext) == null ? undefined : _keyInfo$mediaKeySess.keyStatus) {
33531
33576
  case undefined:
33532
33577
  case 'status-pending':
33533
33578
  case 'usable':
@@ -33692,7 +33737,7 @@
33692
33737
  }
33693
33738
  var PlaylistLoader = /*#__PURE__*/function () {
33694
33739
  function PlaylistLoader(hls) {
33695
- this.hls = void 0;
33740
+ this.hls = undefined;
33696
33741
  this.loaders = Object.create(null);
33697
33742
  this.variableList = null;
33698
33743
  this.onManifestLoaded = this.checkAutostartLoad;
@@ -33877,7 +33922,7 @@
33877
33922
 
33878
33923
  // Override level/track timeout for LL-HLS requests
33879
33924
  // (the default of 10000ms is counter productive to blocking playlist reload requests)
33880
- if (isFiniteNumber((_context$deliveryDire = context.deliveryDirectives) == null ? void 0 : _context$deliveryDire.part)) {
33925
+ if (isFiniteNumber((_context$deliveryDire = context.deliveryDirectives) == null ? undefined : _context$deliveryDire.part)) {
33881
33926
  var levelDetails;
33882
33927
  if (context.type === PlaylistContextType.LEVEL && context.level !== null) {
33883
33928
  levelDetails = this.hls.levels[context.level].details;
@@ -33968,7 +34013,7 @@
33968
34013
  this.variableList = variableList;
33969
34014
  var _M3U8Parser$parseMast = M3U8Parser.parseMasterPlaylistMedia(string, url, parsedResult),
33970
34015
  _M3U8Parser$parseMast2 = _M3U8Parser$parseMast.AUDIO,
33971
- audioTracks = _M3U8Parser$parseMast2 === void 0 ? [] : _M3U8Parser$parseMast2,
34016
+ audioTracks = _M3U8Parser$parseMast2 === undefined ? [] : _M3U8Parser$parseMast2,
33972
34017
  subtitles = _M3U8Parser$parseMast.SUBTITLES,
33973
34018
  captions = _M3U8Parser$parseMast['CLOSED-CAPTIONS'];
33974
34019
  if (audioTracks.length) {
@@ -34072,7 +34117,7 @@
34072
34117
  });
34073
34118
  };
34074
34119
  _proto.handleNetworkError = function handleNetworkError(context, networkDetails, timeout, response, stats) {
34075
- if (timeout === void 0) {
34120
+ if (timeout === undefined) {
34076
34121
  timeout = false;
34077
34122
  }
34078
34123
  var message = "A network " + (timeout ? 'timeout' : 'error' + (response ? ' (status ' + response.code + ')' : '')) + " occurred while loading " + context.type;
@@ -34119,7 +34164,7 @@
34119
34164
  stats: stats
34120
34165
  };
34121
34166
  if (response) {
34122
- var url = (networkDetails == null ? void 0 : networkDetails.url) || context.url;
34167
+ var url = (networkDetails == null ? undefined : networkDetails.url) || context.url;
34123
34168
  errorData.response = _objectSpread2({
34124
34169
  url: url,
34125
34170
  data: undefined
@@ -34235,41 +34280,41 @@
34235
34280
  * @param userConfig - Configuration options applied over `Hls.DefaultConfig`
34236
34281
  */
34237
34282
  function Hls(userConfig) {
34238
- if (userConfig === void 0) {
34283
+ if (userConfig === undefined) {
34239
34284
  userConfig = {};
34240
34285
  }
34241
34286
  /**
34242
34287
  * The runtime configuration used by the player. At instantiation this is combination of `hls.userConfig` merged over `Hls.DefaultConfig`.
34243
34288
  */
34244
- this.config = void 0;
34289
+ this.config = undefined;
34245
34290
  /**
34246
34291
  * The configuration object provided on player instantiation.
34247
34292
  */
34248
- this.userConfig = void 0;
34293
+ this.userConfig = undefined;
34249
34294
  /**
34250
34295
  * The logger functions used by this player instance, configured on player instantiation.
34251
34296
  */
34252
- this.logger = void 0;
34253
- this.coreComponents = void 0;
34254
- this.networkControllers = void 0;
34297
+ this.logger = undefined;
34298
+ this.coreComponents = undefined;
34299
+ this.networkControllers = undefined;
34255
34300
  this._emitter = new EventEmitter();
34256
34301
  this._autoLevelCapping = -1;
34257
34302
  this._maxHdcpLevel = null;
34258
- this.abrController = void 0;
34259
- this.bufferController = void 0;
34260
- this.capLevelController = void 0;
34261
- this.latencyController = void 0;
34262
- this.levelController = void 0;
34263
- this.streamController = void 0;
34264
- this.audioTrackController = void 0;
34265
- this.subtitleTrackController = void 0;
34266
- this.interstitialsController = void 0;
34267
- this.emeController = void 0;
34268
- this.cmcdController = void 0;
34303
+ this.abrController = undefined;
34304
+ this.bufferController = undefined;
34305
+ this.capLevelController = undefined;
34306
+ this.latencyController = undefined;
34307
+ this.levelController = undefined;
34308
+ this.streamController = undefined;
34309
+ this.audioTrackController = undefined;
34310
+ this.subtitleTrackController = undefined;
34311
+ this.interstitialsController = undefined;
34312
+ this.emeController = undefined;
34313
+ this.cmcdController = undefined;
34269
34314
  this._media = null;
34270
34315
  this._url = null;
34271
- this._sessionId = void 0;
34272
- this.triggeringException = void 0;
34316
+ this._sessionId = undefined;
34317
+ this.triggeringException = undefined;
34273
34318
  this.started = false;
34274
34319
  var logger = this.logger = enableLogs(userConfig.debug || false, 'Hls instance', userConfig.assetPlayerId);
34275
34320
  var config = this.config = mergeConfig(Hls.DefaultConfig, userConfig, logger);
@@ -34377,13 +34422,13 @@
34377
34422
  // Delegate the EventEmitter through the public API of Hls.js
34378
34423
  ;
34379
34424
  _proto.on = function on(event, listener, context) {
34380
- if (context === void 0) {
34425
+ if (context === undefined) {
34381
34426
  context = this;
34382
34427
  }
34383
34428
  this._emitter.on(event, listener, context);
34384
34429
  };
34385
34430
  _proto.once = function once(event, listener, context) {
34386
- if (context === void 0) {
34431
+ if (context === undefined) {
34387
34432
  context = this;
34388
34433
  }
34389
34434
  this._emitter.once(event, listener, context);
@@ -34392,7 +34437,7 @@
34392
34437
  this._emitter.removeAllListeners(event);
34393
34438
  };
34394
34439
  _proto.off = function off(event, listener, context, once) {
34395
- if (context === void 0) {
34440
+ if (context === undefined) {
34396
34441
  context = this;
34397
34442
  }
34398
34443
  this._emitter.off(event, listener, context, once);
@@ -34541,7 +34586,7 @@
34541
34586
  * Defaults to -1 (None: starts from earliest point)
34542
34587
  */
34543
34588
  _proto.startLoad = function startLoad(startPosition, skipSeekToStartPosition) {
34544
- if (startPosition === void 0) {
34589
+ if (startPosition === undefined) {
34545
34590
  startPosition = -1;
34546
34591
  }
34547
34592
  this.logger.log("startLoad(" + (startPosition + (skipSeekToStartPosition ? ', <skip seek to start>' : '')) + ")");
@@ -34618,7 +34663,7 @@
34618
34663
  _proto.recoverMediaError = function recoverMediaError() {
34619
34664
  this.logger.log('recoverMediaError');
34620
34665
  var media = this._media;
34621
- var time = media == null ? void 0 : media.currentTime;
34666
+ var time = media == null ? undefined : media.currentTime;
34622
34667
  this.detachMedia();
34623
34668
  if (media) {
34624
34669
  this.attachMedia(media);
@@ -34640,7 +34685,7 @@
34640
34685
  */
34641
34686
  _proto.setAudioOption = function setAudioOption(audioOption) {
34642
34687
  var _this$audioTrackContr;
34643
- return ((_this$audioTrackContr = this.audioTrackController) == null ? void 0 : _this$audioTrackContr.setAudioOption(audioOption)) || null;
34688
+ return ((_this$audioTrackContr = this.audioTrackController) == null ? undefined : _this$audioTrackContr.setAudioOption(audioOption)) || null;
34644
34689
  }
34645
34690
  /**
34646
34691
  * Find and select the best matching subtitle track, making a level switch when a Group change is necessary.
@@ -34648,7 +34693,7 @@
34648
34693
  */;
34649
34694
  _proto.setSubtitleOption = function setSubtitleOption(subtitleOption) {
34650
34695
  var _this$subtitleTrackCo;
34651
- return ((_this$subtitleTrackCo = this.subtitleTrackController) == null ? void 0 : _this$subtitleTrackCo.setSubtitleOption(subtitleOption)) || null;
34696
+ return ((_this$subtitleTrackCo = this.subtitleTrackController) == null ? undefined : _this$subtitleTrackCo.setSubtitleOption(subtitleOption)) || null;
34652
34697
  }
34653
34698
 
34654
34699
  /**
@@ -34658,7 +34703,7 @@
34658
34703
  * returns mediaCapabilities.decodingInfo for a variant/rendition
34659
34704
  */
34660
34705
  _proto.getMediaDecodingInfo = function getMediaDecodingInfo(level, audioTracks) {
34661
- if (audioTracks === void 0) {
34706
+ if (audioTracks === undefined) {
34662
34707
  audioTracks = this.allAudioTracks;
34663
34708
  }
34664
34709
  var audioTracksByGroup = getAudioTracksByGroup(audioTracks);
@@ -35261,7 +35306,7 @@
35261
35306
  key: "interstitialsManager",
35262
35307
  get: function get() {
35263
35308
  var _this$interstitialsCo;
35264
- return ((_this$interstitialsCo = this.interstitialsController) == null ? void 0 : _this$interstitialsCo.interstitialsManager) || null;
35309
+ return ((_this$interstitialsCo = this.interstitialsController) == null ? undefined : _this$interstitialsCo.interstitialsManager) || null;
35265
35310
  }
35266
35311
  }], [{
35267
35312
  key: "version",
@@ -35313,7 +35358,7 @@
35313
35358
  }
35314
35359
  }]);
35315
35360
  }();
35316
- Hls.defaultConfig = void 0;
35361
+ Hls.defaultConfig = undefined;
35317
35362
 
35318
35363
  return Hls;
35319
35364