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EAAM4R,IAAK8jD,EAAWz2D,IAE1E,EAMD,EAAoBoZ,EAAI,CAAC7X,EAAKm1D,IAAUl3D,OAAOS,UAAUC,eAAeC,KAAKoB,EAAKm1D,GAMlF,EAAoBh4D,EAAK03D,IACH,oBAAXv0D,QAA0BA,OAAO80D,aAC1Cn3D,OAAO8B,eAAe80D,EAASv0D,OAAO80D,YAAa,CAAEn1D,MAAO,WAE7DhC,OAAO8B,eAAe80D,EAAS,aAAc,CAAE50D,OAAO,GAAO,EAS/D,IAAI/C,EAAsB,EAAoB,gBAG9C,OAFAA,EAAsBA,EAA6B,OAGnD,EAvjoBM,GARd43D,EAAOD,QAAU/3D","sources":["webpack://sakurairo-scripts/./node_modules/.pnpm/hls.js@1.3.5/node_modules/hls.js/dist/hls.light.js"],"sourcesContent":["typeof window !== \"undefined\" &&\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Hls\"] = factory();\n\telse\n\t\troot[\"Hls\"] = factory();\n})(this, () => {\nreturn /******/ (() => { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./src/config.ts\":\n/*!***********************!*\\\n !*** ./src/config.ts ***!\n \\***********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"enableStreamingMode\": () => (/* binding */ enableStreamingMode),\n/* harmony export */ \"hlsDefaultConfig\": () => (/* binding */ hlsDefaultConfig),\n/* harmony export */ \"mergeConfig\": () => (/* binding */ mergeConfig)\n/* harmony export */ });\n/* harmony import */ var _controller_abr_controller__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./controller/abr-controller */ \"./src/controller/abr-controller.ts\");\n/* harmony import */ var _controller_audio_stream_controller__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/cues */ \"./src/empty.js\");\n/* harmony import */ var _controller_audio_stream_controller__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_controller_audio_stream_controller__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _controller_buffer_controller__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./controller/buffer-controller */ \"./src/controller/buffer-controller.ts\");\n/* harmony import */ var _controller_cap_level_controller__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./controller/cap-level-controller */ \"./src/controller/cap-level-controller.ts\");\n/* harmony import */ var _controller_fps_controller__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./controller/fps-controller */ \"./src/controller/fps-controller.ts\");\n/* harmony import */ var _utils_xhr_loader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/xhr-loader */ \"./src/utils/xhr-loader.ts\");\n/* harmony import */ var _utils_fetch_loader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/fetch-loader */ \"./src/utils/fetch-loader.ts\");\n/* harmony import */ var _utils_mediakeys_helper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/mediakeys-helper */ \"./src/utils/mediakeys-helper.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/logger */ \"./src/utils/logger.ts\");\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// If possible, keep hlsDefaultConfig shallow\n// It is cloned whenever a new Hls instance is created, by keeping the config\n// shallow the properties are cloned, and we don't end up manipulating the default\nvar hlsDefaultConfig = _objectSpread(_objectSpread({\n autoStartLoad: true,\n // used by stream-controller\n startPosition: -1,\n // used by stream-controller\n defaultAudioCodec: undefined,\n // used by stream-controller\n debug: false,\n // used by logger\n capLevelOnFPSDrop: false,\n // used by fps-controller\n capLevelToPlayerSize: false,\n // used by cap-level-controller\n ignoreDevicePixelRatio: false,\n // used by cap-level-controller\n initialLiveManifestSize: 1,\n // used by stream-controller\n maxBufferLength: 30,\n // used by stream-controller\n backBufferLength: Infinity,\n // used by buffer-controller\n maxBufferSize: 60 * 1000 * 1000,\n // used by stream-controller\n maxBufferHole: 0.1,\n // used by stream-controller\n highBufferWatchdogPeriod: 2,\n // used by stream-controller\n nudgeOffset: 0.1,\n // used by stream-controller\n nudgeMaxRetry: 3,\n // used by stream-controller\n maxFragLookUpTolerance: 0.25,\n // used by stream-controller\n liveSyncDurationCount: 3,\n // used by latency-controller\n liveMaxLatencyDurationCount: Infinity,\n // used by latency-controller\n liveSyncDuration: undefined,\n // used by latency-controller\n liveMaxLatencyDuration: undefined,\n // used by latency-controller\n maxLiveSyncPlaybackRate: 1,\n // used by latency-controller\n liveDurationInfinity: false,\n // used by buffer-controller\n liveBackBufferLength: null,\n // used by buffer-controller\n maxMaxBufferLength: 600,\n // used by stream-controller\n enableWorker: true,\n // used by demuxer\n enableSoftwareAES: true,\n // used by decrypter\n manifestLoadingTimeOut: 10000,\n // used by playlist-loader\n manifestLoadingMaxRetry: 1,\n // used by playlist-loader\n manifestLoadingRetryDelay: 1000,\n // used by playlist-loader\n manifestLoadingMaxRetryTimeout: 64000,\n // used by playlist-loader\n startLevel: undefined,\n // used by level-controller\n levelLoadingTimeOut: 10000,\n // used by playlist-loader\n levelLoadingMaxRetry: 4,\n // used by playlist-loader\n levelLoadingRetryDelay: 1000,\n // used by playlist-loader\n levelLoadingMaxRetryTimeout: 64000,\n // used by playlist-loader\n fragLoadingTimeOut: 20000,\n // used by fragment-loader\n fragLoadingMaxRetry: 6,\n // used by fragment-loader\n fragLoadingRetryDelay: 1000,\n // used by fragment-loader\n fragLoadingMaxRetryTimeout: 64000,\n // used by fragment-loader\n startFragPrefetch: false,\n // used by stream-controller\n fpsDroppedMonitoringPeriod: 5000,\n // used by fps-controller\n fpsDroppedMonitoringThreshold: 0.2,\n // used by fps-controller\n appendErrorMaxRetry: 3,\n // used by buffer-controller\n loader: _utils_xhr_loader__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n // loader: FetchLoader,\n fLoader: undefined,\n // used by fragment-loader\n pLoader: undefined,\n // used by playlist-loader\n xhrSetup: undefined,\n // used by xhr-loader\n licenseXhrSetup: undefined,\n // used by eme-controller\n licenseResponseCallback: undefined,\n // used by eme-controller\n abrController: _controller_abr_controller__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n bufferController: _controller_buffer_controller__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n capLevelController: _controller_cap_level_controller__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n fpsController: _controller_fps_controller__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n stretchShortVideoTrack: false,\n // used by mp4-remuxer\n maxAudioFramesDrift: 1,\n // used by mp4-remuxer\n forceKeyFrameOnDiscontinuity: true,\n // used by ts-demuxer\n abrEwmaFastLive: 3,\n // used by abr-controller\n abrEwmaSlowLive: 9,\n // used by abr-controller\n abrEwmaFastVoD: 3,\n // used by abr-controller\n abrEwmaSlowVoD: 9,\n // used by abr-controller\n abrEwmaDefaultEstimate: 5e5,\n // 500 kbps // used by abr-controller\n abrBandWidthFactor: 0.95,\n // used by abr-controller\n abrBandWidthUpFactor: 0.7,\n // used by abr-controller\n abrMaxWithRealBitrate: false,\n // used by abr-controller\n maxStarvationDelay: 4,\n // used by abr-controller\n maxLoadingDelay: 4,\n // used by abr-controller\n minAutoBitrate: 0,\n // used by hls\n emeEnabled: false,\n // used by eme-controller\n widevineLicenseUrl: undefined,\n // used by eme-controller\n drmSystems: {},\n // used by eme-controller\n drmSystemOptions: {},\n // used by eme-controller\n requestMediaKeySystemAccessFunc: _utils_mediakeys_helper__WEBPACK_IMPORTED_MODULE_7__.requestMediaKeySystemAccess,\n // used by eme-controller\n testBandwidth: true,\n progressive: false,\n lowLatencyMode: true,\n cmcd: undefined,\n enableDateRangeMetadataCues: true,\n enableEmsgMetadataCues: true,\n enableID3MetadataCues: true\n}, timelineConfig()), {}, {\n subtitleStreamController: false ? 0 : undefined,\n subtitleTrackController: false ? 0 : undefined,\n timelineController: false ? 0 : undefined,\n audioStreamController: false ? 0 : undefined,\n audioTrackController: false ? 0 : undefined,\n emeController: false ? 0 : undefined,\n cmcdController: false ? 0 : undefined\n});\nfunction timelineConfig() {\n return {\n cueHandler: (_controller_audio_stream_controller__WEBPACK_IMPORTED_MODULE_1___default()),\n // used by timeline-controller\n enableWebVTT: false,\n // used by timeline-controller\n enableIMSC1: false,\n // used by timeline-controller\n enableCEA708Captions: false,\n // used by timeline-controller\n captionsTextTrack1Label: 'English',\n // used by timeline-controller\n captionsTextTrack1LanguageCode: 'en',\n // used by timeline-controller\n captionsTextTrack2Label: 'Spanish',\n // used by timeline-controller\n captionsTextTrack2LanguageCode: 'es',\n // used by timeline-controller\n captionsTextTrack3Label: 'Unknown CC',\n // used by timeline-controller\n captionsTextTrack3LanguageCode: '',\n // used by timeline-controller\n captionsTextTrack4Label: 'Unknown CC',\n // used by timeline-controller\n captionsTextTrack4LanguageCode: '',\n // used by timeline-controller\n renderTextTracksNatively: true\n };\n}\nfunction mergeConfig(defaultConfig, userConfig) {\n if ((userConfig.liveSyncDurationCount || userConfig.liveMaxLatencyDurationCount) && (userConfig.liveSyncDuration || userConfig.liveMaxLatencyDuration)) {\n throw new Error(\"Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration\");\n }\n if (userConfig.liveMaxLatencyDurationCount !== undefined && (userConfig.liveSyncDurationCount === undefined || userConfig.liveMaxLatencyDurationCount <= userConfig.liveSyncDurationCount)) {\n throw new Error('Illegal hls.js config: \"liveMaxLatencyDurationCount\" must be greater than \"liveSyncDurationCount\"');\n }\n if (userConfig.liveMaxLatencyDuration !== undefined && (userConfig.liveSyncDuration === undefined || userConfig.liveMaxLatencyDuration <= userConfig.liveSyncDuration)) {\n throw new Error('Illegal hls.js config: \"liveMaxLatencyDuration\" must be greater than \"liveSyncDuration\"');\n }\n return _extends({}, defaultConfig, userConfig);\n}\nfunction enableStreamingMode(config) {\n var currentLoader = config.loader;\n if (currentLoader !== _utils_fetch_loader__WEBPACK_IMPORTED_MODULE_6__[\"default\"] && currentLoader !== _utils_xhr_loader__WEBPACK_IMPORTED_MODULE_5__[\"default\"]) {\n // If a developer has configured their own loader, respect that choice\n _utils_logger__WEBPACK_IMPORTED_MODULE_8__.logger.log('[config]: Custom loader detected, cannot enable progressive streaming');\n config.progressive = false;\n } else {\n var canStreamProgressively = (0,_utils_fetch_loader__WEBPACK_IMPORTED_MODULE_6__.fetchSupported)();\n if (canStreamProgressively) {\n config.loader = _utils_fetch_loader__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n config.progressive = true;\n config.enableSoftwareAES = true;\n _utils_logger__WEBPACK_IMPORTED_MODULE_8__.logger.log('[config]: Progressive streaming enabled, using FetchLoader');\n }\n }\n}\n\n/***/ }),\n\n/***/ \"./src/controller/abr-controller.ts\":\n/*!******************************************!*\\\n !*** ./src/controller/abr-controller.ts ***!\n \\******************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _utils_ewma_bandwidth_estimator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/ewma-bandwidth-estimator */ \"./src/utils/ewma-bandwidth-estimator.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _types_loader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../types/loader */ \"./src/types/loader.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n\n\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\n\n\nvar AbrController = /*#__PURE__*/function () {\n function AbrController(hls) {\n this.hls = void 0;\n this.lastLoadedFragLevel = 0;\n this._nextAutoLevel = -1;\n this.timer = void 0;\n this.onCheck = this._abandonRulesCheck.bind(this);\n this.fragCurrent = null;\n this.partCurrent = null;\n this.bitrateTestDelay = 0;\n this.bwEstimator = void 0;\n this.hls = hls;\n var config = hls.config;\n this.bwEstimator = new _utils_ewma_bandwidth_estimator__WEBPACK_IMPORTED_MODULE_1__[\"default\"](config.abrEwmaSlowVoD, config.abrEwmaFastVoD, config.abrEwmaDefaultEstimate);\n this.registerListeners();\n }\n var _proto = AbrController.prototype;\n _proto.registerListeners = function registerListeners() {\n var hls = this.hls;\n hls.on(_events__WEBPACK_IMPORTED_MODULE_2__.Events.FRAG_LOADING, this.onFragLoading, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_2__.Events.FRAG_LOADED, this.onFragLoaded, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_2__.Events.FRAG_BUFFERED, this.onFragBuffered, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_2__.Events.LEVEL_LOADED, this.onLevelLoaded, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_2__.Events.ERROR, this.onError, this);\n };\n _proto.unregisterListeners = function unregisterListeners() {\n var hls = this.hls;\n hls.off(_events__WEBPACK_IMPORTED_MODULE_2__.Events.FRAG_LOADING, this.onFragLoading, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_2__.Events.FRAG_LOADED, this.onFragLoaded, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_2__.Events.FRAG_BUFFERED, this.onFragBuffered, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_2__.Events.LEVEL_LOADED, this.onLevelLoaded, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_2__.Events.ERROR, this.onError, this);\n };\n _proto.destroy = function destroy() {\n this.unregisterListeners();\n this.clearTimer();\n // @ts-ignore\n this.hls = this.onCheck = null;\n this.fragCurrent = this.partCurrent = null;\n };\n _proto.onFragLoading = function onFragLoading(event, data) {\n var frag = data.frag;\n if (frag.type === _types_loader__WEBPACK_IMPORTED_MODULE_4__.PlaylistLevelType.MAIN) {\n if (!this.timer) {\n var _data$part;\n this.fragCurrent = frag;\n this.partCurrent = (_data$part = data.part) != null ? _data$part : null;\n this.timer = self.setInterval(this.onCheck, 100);\n }\n }\n };\n _proto.onLevelLoaded = function onLevelLoaded(event, data) {\n var config = this.hls.config;\n if (data.details.live) {\n this.bwEstimator.update(config.abrEwmaSlowLive, config.abrEwmaFastLive);\n } else {\n this.bwEstimator.update(config.abrEwmaSlowVoD, config.abrEwmaFastVoD);\n }\n }\n\n /*\n This method monitors the download rate of the current fragment, and will downswitch if that fragment will not load\n quickly enough to prevent underbuffering\n */;\n _proto._abandonRulesCheck = function _abandonRulesCheck() {\n var frag = this.fragCurrent,\n part = this.partCurrent,\n hls = this.hls;\n var autoLevelEnabled = hls.autoLevelEnabled,\n media = hls.media;\n if (!frag || !media) {\n return;\n }\n var stats = part ? part.stats : frag.stats;\n var duration = part ? part.duration : frag.duration;\n // If frag loading is aborted, complete, or from lowest level, stop timer and return\n if (stats.aborted || stats.loaded && stats.loaded === stats.total || frag.level === 0) {\n this.clearTimer();\n // reset forced auto level value so that next level will be selected\n this._nextAutoLevel = -1;\n return;\n }\n\n // This check only runs if we're in ABR mode and actually playing\n if (!autoLevelEnabled || media.paused || !media.playbackRate || !media.readyState) {\n return;\n }\n var bufferInfo = hls.mainForwardBufferInfo;\n if (bufferInfo === null) {\n return;\n }\n var requestDelay = performance.now() - stats.loading.start;\n var playbackRate = Math.abs(media.playbackRate);\n // In order to work with a stable bandwidth, only begin monitoring bandwidth after half of the fragment has been loaded\n if (requestDelay <= 500 * duration / playbackRate) {\n return;\n }\n var loadedFirstByte = stats.loaded && stats.loading.first;\n var bwEstimate = this.bwEstimator.getEstimate();\n var levels = hls.levels,\n minAutoLevel = hls.minAutoLevel;\n var level = levels[frag.level];\n var expectedLen = stats.total || Math.max(stats.loaded, Math.round(duration * level.maxBitrate / 8));\n var loadRate = loadedFirstByte ? stats.loaded * 1000 / requestDelay : 0;\n\n // fragLoadDelay is an estimate of the time (in seconds) it will take to buffer the remainder of the fragment\n var fragLoadedDelay = loadRate ? (expectedLen - stats.loaded) / loadRate : expectedLen * 8 / bwEstimate;\n\n // bufferStarvationDelay is an estimate of the amount time (in seconds) it will take to exhaust the buffer\n var bufferStarvationDelay = bufferInfo.len / playbackRate;\n\n // Only downswitch if the time to finish loading the current fragment is greater than the amount of buffer left\n if (fragLoadedDelay <= bufferStarvationDelay) {\n return;\n }\n var fragLevelNextLoadedDelay = Number.POSITIVE_INFINITY;\n var nextLoadLevel;\n // Iterate through lower level and try to find the largest one that avoids rebuffering\n for (nextLoadLevel = frag.level - 1; nextLoadLevel > minAutoLevel; nextLoadLevel--) {\n // compute time to load next fragment at lower level\n // 0.8 : consider only 80% of current bw to be conservative\n // 8 = bits per byte (bps/Bps)\n var levelNextBitrate = levels[nextLoadLevel].maxBitrate;\n fragLevelNextLoadedDelay = loadRate ? duration * levelNextBitrate / (8 * 0.8 * loadRate) : duration * levelNextBitrate / bwEstimate;\n if (fragLevelNextLoadedDelay < bufferStarvationDelay) {\n break;\n }\n }\n // Only emergency switch down if it takes less time to load a new fragment at lowest level instead of continuing\n // to load the current one\n if (fragLevelNextLoadedDelay >= fragLoadedDelay) {\n return;\n }\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.warn(\"Fragment \" + frag.sn + (part ? ' part ' + part.index : '') + \" of level \" + frag.level + \" is loading too slowly and will cause an underbuffer; aborting and switching to level \" + nextLoadLevel + \"\\n Current BW estimate: \" + ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(bwEstimate) ? (bwEstimate / 1024).toFixed(3) : 'Unknown') + \" Kb/s\\n Estimated load time for current fragment: \" + fragLoadedDelay.toFixed(3) + \" s\\n Estimated load time for the next fragment: \" + fragLevelNextLoadedDelay.toFixed(3) + \" s\\n Time to underbuffer: \" + bufferStarvationDelay.toFixed(3) + \" s\");\n hls.nextLoadLevel = nextLoadLevel;\n if (loadedFirstByte) {\n // If there has been loading progress, sample bandwidth\n this.bwEstimator.sample(requestDelay, stats.loaded);\n }\n this.clearTimer();\n if (frag.loader || frag.keyLoader) {\n this.fragCurrent = this.partCurrent = null;\n frag.abortRequests();\n }\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_2__.Events.FRAG_LOAD_EMERGENCY_ABORTED, {\n frag: frag,\n part: part,\n stats: stats\n });\n };\n _proto.onFragLoaded = function onFragLoaded(event, _ref) {\n var frag = _ref.frag,\n part = _ref.part;\n if (frag.type === _types_loader__WEBPACK_IMPORTED_MODULE_4__.PlaylistLevelType.MAIN && (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(frag.sn)) {\n var stats = part ? part.stats : frag.stats;\n var duration = part ? part.duration : frag.duration;\n // stop monitoring bw once frag loaded\n this.clearTimer();\n // store level id after successful fragment load\n this.lastLoadedFragLevel = frag.level;\n // reset forced auto level value so that next level will be selected\n this._nextAutoLevel = -1;\n\n // compute level average bitrate\n if (this.hls.config.abrMaxWithRealBitrate) {\n var level = this.hls.levels[frag.level];\n var loadedBytes = (level.loaded ? level.loaded.bytes : 0) + stats.loaded;\n var loadedDuration = (level.loaded ? level.loaded.duration : 0) + duration;\n level.loaded = {\n bytes: loadedBytes,\n duration: loadedDuration\n };\n level.realBitrate = Math.round(8 * loadedBytes / loadedDuration);\n }\n if (frag.bitrateTest) {\n var fragBufferedData = {\n stats: stats,\n frag: frag,\n part: part,\n id: frag.type\n };\n this.onFragBuffered(_events__WEBPACK_IMPORTED_MODULE_2__.Events.FRAG_BUFFERED, fragBufferedData);\n }\n }\n };\n _proto.onFragBuffered = function onFragBuffered(event, data) {\n var frag = data.frag,\n part = data.part;\n var stats = part ? part.stats : frag.stats;\n if (stats.aborted) {\n return;\n }\n // Only count non-alt-audio frags which were actually buffered in our BW calculations\n if (frag.type !== _types_loader__WEBPACK_IMPORTED_MODULE_4__.PlaylistLevelType.MAIN || frag.sn === 'initSegment') {\n return;\n }\n // Use the difference between parsing and request instead of buffering and request to compute fragLoadingProcessing;\n // rationale is that buffer appending only happens once media is attached. This can happen when config.startFragPrefetch\n // is used. If we used buffering in that case, our BW estimate sample will be very large.\n var processingMs = stats.parsing.end - stats.loading.start;\n this.bwEstimator.sample(processingMs, stats.loaded);\n stats.bwEstimate = this.bwEstimator.getEstimate();\n if (frag.bitrateTest) {\n this.bitrateTestDelay = processingMs / 1000;\n } else {\n this.bitrateTestDelay = 0;\n }\n };\n _proto.onError = function onError(event, data) {\n var _data$frag;\n // stop timer in case of frag loading error\n if (((_data$frag = data.frag) === null || _data$frag === void 0 ? void 0 : _data$frag.type) === _types_loader__WEBPACK_IMPORTED_MODULE_4__.PlaylistLevelType.MAIN) {\n if (data.type === _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorTypes.KEY_SYSTEM_ERROR) {\n this.clearTimer();\n return;\n }\n switch (data.details) {\n case _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorDetails.KEY_LOAD_ERROR:\n case _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorDetails.KEY_LOAD_TIMEOUT:\n this.clearTimer();\n break;\n default:\n break;\n }\n }\n };\n _proto.clearTimer = function clearTimer() {\n self.clearInterval(this.timer);\n this.timer = undefined;\n }\n\n // return next auto level\n ;\n _proto.getNextABRAutoLevel = function getNextABRAutoLevel() {\n var fragCurrent = this.fragCurrent,\n partCurrent = this.partCurrent,\n hls = this.hls;\n var maxAutoLevel = hls.maxAutoLevel,\n config = hls.config,\n minAutoLevel = hls.minAutoLevel,\n media = hls.media;\n var currentFragDuration = partCurrent ? partCurrent.duration : fragCurrent ? fragCurrent.duration : 0;\n\n // playbackRate is the absolute value of the playback rate; if media.playbackRate is 0, we use 1 to load as\n // if we're playing back at the normal rate.\n var playbackRate = media && media.playbackRate !== 0 ? Math.abs(media.playbackRate) : 1.0;\n var avgbw = this.bwEstimator ? this.bwEstimator.getEstimate() : config.abrEwmaDefaultEstimate;\n // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.\n var bufferInfo = hls.mainForwardBufferInfo;\n var bufferStarvationDelay = (bufferInfo ? bufferInfo.len : 0) / playbackRate;\n\n // First, look to see if we can find a level matching with our avg bandwidth AND that could also guarantee no rebuffering at all\n var bestLevel = this.findBestLevel(avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay, config.abrBandWidthFactor, config.abrBandWidthUpFactor);\n if (bestLevel >= 0) {\n return bestLevel;\n }\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.trace((bufferStarvationDelay ? 'rebuffering expected' : 'buffer is empty') + \", finding optimal quality level\");\n // not possible to get rid of rebuffering ... let's try to find level that will guarantee less than maxStarvationDelay of rebuffering\n // if no matching level found, logic will return 0\n var maxStarvationDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxStarvationDelay) : config.maxStarvationDelay;\n var bwFactor = config.abrBandWidthFactor;\n var bwUpFactor = config.abrBandWidthUpFactor;\n if (!bufferStarvationDelay) {\n // in case buffer is empty, let's check if previous fragment was loaded to perform a bitrate test\n var bitrateTestDelay = this.bitrateTestDelay;\n if (bitrateTestDelay) {\n // if it is the case, then we need to adjust our max starvation delay using maxLoadingDelay config value\n // max video loading delay used in automatic start level selection :\n // in that mode ABR controller will ensure that video loading time (ie the time to fetch the first fragment at lowest quality level +\n // the time to fetch the fragment at the appropriate quality level is less than ```maxLoadingDelay``` )\n // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration\n var maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxLoadingDelay) : config.maxLoadingDelay;\n maxStarvationDelay = maxLoadingDelay - bitrateTestDelay;\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.trace(\"bitrate test took \" + Math.round(1000 * bitrateTestDelay) + \"ms, set first fragment max fetchDuration to \" + Math.round(1000 * maxStarvationDelay) + \" ms\");\n // don't use conservative factor on bitrate test\n bwFactor = bwUpFactor = 1;\n }\n }\n bestLevel = this.findBestLevel(avgbw, minAutoLevel, maxAutoLevel, bufferStarvationDelay + maxStarvationDelay, bwFactor, bwUpFactor);\n return Math.max(bestLevel, 0);\n };\n _proto.findBestLevel = function findBestLevel(currentBw, minAutoLevel, maxAutoLevel, maxFetchDuration, bwFactor, bwUpFactor) {\n var _level$details;\n var fragCurrent = this.fragCurrent,\n partCurrent = this.partCurrent,\n currentLevel = this.lastLoadedFragLevel;\n var levels = this.hls.levels;\n var level = levels[currentLevel];\n var live = !!(level !== null && level !== void 0 && (_level$details = level.details) !== null && _level$details !== void 0 && _level$details.live);\n var currentCodecSet = level === null || level === void 0 ? void 0 : level.codecSet;\n var currentFragDuration = partCurrent ? partCurrent.duration : fragCurrent ? fragCurrent.duration : 0;\n for (var i = maxAutoLevel; i >= minAutoLevel; i--) {\n var levelInfo = levels[i];\n if (!levelInfo || currentCodecSet && levelInfo.codecSet !== currentCodecSet) {\n continue;\n }\n var levelDetails = levelInfo.details;\n var avgDuration = (partCurrent ? levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.partTarget : levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.averagetargetduration) || currentFragDuration;\n var adjustedbw = void 0;\n // follow algorithm captured from stagefright :\n // https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp\n // Pick the highest bandwidth stream below or equal to estimated bandwidth.\n // consider only 80% of the available bandwidth, but if we are switching up,\n // be even more conservative (70%) to avoid overestimating and immediately\n // switching back.\n if (i <= currentLevel) {\n adjustedbw = bwFactor * currentBw;\n } else {\n adjustedbw = bwUpFactor * currentBw;\n }\n var bitrate = levels[i].maxBitrate;\n var fetchDuration = bitrate * avgDuration / adjustedbw;\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.trace(\"level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: \" + i + \"/\" + Math.round(adjustedbw) + \"/\" + bitrate + \"/\" + avgDuration + \"/\" + maxFetchDuration + \"/\" + fetchDuration);\n // if adjusted bw is greater than level bitrate AND\n if (adjustedbw > bitrate && (\n // fragment fetchDuration unknown OR live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches\n // we don't account for max Fetch Duration for live streams, this is to avoid switching down when near the edge of live sliding window ...\n // special case to support startLevel = -1 (bitrateTest) on live streams : in that case we should not exit loop so that findBestLevel will return -1\n fetchDuration === 0 || !(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(fetchDuration) || live && !this.bitrateTestDelay || fetchDuration < maxFetchDuration)) {\n // as we are looping from highest to lowest, this will return the best achievable quality level\n return i;\n }\n }\n // not enough time budget even with quality level 0 ... rebuffering might happen\n return -1;\n };\n _createClass(AbrController, [{\n key: \"nextAutoLevel\",\n get: function get() {\n var forcedAutoLevel = this._nextAutoLevel;\n var bwEstimator = this.bwEstimator;\n // in case next auto level has been forced, and bw not available or not reliable, return forced value\n if (forcedAutoLevel !== -1 && !bwEstimator.canEstimate()) {\n return forcedAutoLevel;\n }\n\n // compute next level using ABR logic\n var nextABRAutoLevel = this.getNextABRAutoLevel();\n // use forced auto level when ABR selected level has errored\n if (forcedAutoLevel !== -1 && this.hls.levels[nextABRAutoLevel].loadError) {\n return forcedAutoLevel;\n }\n // if forced auto level has been defined, use it to cap ABR computed quality level\n if (forcedAutoLevel !== -1) {\n nextABRAutoLevel = Math.min(forcedAutoLevel, nextABRAutoLevel);\n }\n return nextABRAutoLevel;\n },\n set: function set(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n }]);\n return AbrController;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AbrController);\n\n/***/ }),\n\n/***/ \"./src/controller/base-playlist-controller.ts\":\n/*!****************************************************!*\\\n !*** ./src/controller/base-playlist-controller.ts ***!\n \\****************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ BasePlaylistController)\n/* harmony export */ });\n/* harmony import */ var _types_level__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types/level */ \"./src/types/level.ts\");\n/* harmony import */ var _level_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./level-helper */ \"./src/controller/level-helper.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n\n\n\n\nvar BasePlaylistController = /*#__PURE__*/function () {\n function BasePlaylistController(hls, logPrefix) {\n this.hls = void 0;\n this.timer = -1;\n this.requestScheduled = -1;\n this.canLoad = false;\n this.retryCount = 0;\n this.log = void 0;\n this.warn = void 0;\n this.log = _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log.bind(_utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger, logPrefix + \":\");\n this.warn = _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.warn.bind(_utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger, logPrefix + \":\");\n this.hls = hls;\n }\n var _proto = BasePlaylistController.prototype;\n _proto.destroy = function destroy() {\n this.clearTimer();\n // @ts-ignore\n this.hls = this.log = this.warn = null;\n };\n _proto.onError = function onError(event, data) {\n if (data.fatal && (data.type === _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorTypes.NETWORK_ERROR || data.type === _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorTypes.KEY_SYSTEM_ERROR)) {\n this.stopLoad();\n }\n };\n _proto.clearTimer = function clearTimer() {\n clearTimeout(this.timer);\n this.timer = -1;\n };\n _proto.startLoad = function startLoad() {\n this.canLoad = true;\n this.retryCount = 0;\n this.requestScheduled = -1;\n this.loadPlaylist();\n };\n _proto.stopLoad = function stopLoad() {\n this.canLoad = false;\n this.clearTimer();\n };\n _proto.switchParams = function switchParams(playlistUri, previous) {\n var renditionReports = previous === null || previous === void 0 ? void 0 : previous.renditionReports;\n if (renditionReports) {\n for (var i = 0; i < renditionReports.length; i++) {\n var attr = renditionReports[i];\n var uri = void 0;\n try {\n uri = new self.URL(attr.URI, previous.url).href;\n } catch (error) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.warn(\"Could not construct new URL for Rendition Report: \" + error);\n uri = attr.URI || '';\n }\n if (uri === playlistUri.slice(-uri.length)) {\n var msn = parseInt(attr['LAST-MSN']) || (previous === null || previous === void 0 ? void 0 : previous.lastPartSn);\n var part = parseInt(attr['LAST-PART']) || (previous === null || previous === void 0 ? void 0 : previous.lastPartIndex);\n if (this.hls.config.lowLatencyMode) {\n var currentGoal = Math.min(previous.age - previous.partTarget, previous.targetduration);\n if (part >= 0 && currentGoal > previous.partTarget) {\n part += 1;\n }\n }\n return new _types_level__WEBPACK_IMPORTED_MODULE_0__.HlsUrlParameters(msn, part >= 0 ? part : undefined, _types_level__WEBPACK_IMPORTED_MODULE_0__.HlsSkip.No);\n }\n }\n }\n };\n _proto.loadPlaylist = function loadPlaylist(hlsUrlParameters) {\n if (this.requestScheduled === -1) {\n this.requestScheduled = self.performance.now();\n }\n };\n _proto.shouldLoadTrack = function shouldLoadTrack(track) {\n return this.canLoad && track && !!track.url && (!track.details || track.details.live);\n };\n _proto.playlistLoaded = function playlistLoaded(index, data, previousDetails) {\n var _this = this;\n var details = data.details,\n stats = data.stats;\n\n // Set last updated date-time\n var now = self.performance.now();\n var elapsed = stats.loading.first ? Math.max(0, now - stats.loading.first) : 0;\n details.advancedDateTime = Date.now() - elapsed;\n\n // if current playlist is a live playlist, arm a timer to reload it\n if (details.live || previousDetails !== null && previousDetails !== void 0 && previousDetails.live) {\n details.reloaded(previousDetails);\n if (previousDetails) {\n this.log(\"live playlist \" + index + \" \" + (details.advanced ? 'REFRESHED ' + details.lastPartSn + '-' + details.lastPartIndex : 'MISSED'));\n }\n // Merge live playlists to adjust fragment starts and fill in delta playlist skipped segments\n if (previousDetails && details.fragments.length > 0) {\n (0,_level_helper__WEBPACK_IMPORTED_MODULE_1__.mergeDetails)(previousDetails, details);\n }\n if (!this.canLoad || !details.live) {\n return;\n }\n var deliveryDirectives;\n var msn = undefined;\n var part = undefined;\n if (details.canBlockReload && details.endSN && details.advanced) {\n // Load level with LL-HLS delivery directives\n var lowLatencyMode = this.hls.config.lowLatencyMode;\n var lastPartSn = details.lastPartSn;\n var endSn = details.endSN;\n var lastPartIndex = details.lastPartIndex;\n var hasParts = lastPartIndex !== -1;\n var lastPart = lastPartSn === endSn;\n // When low latency mode is disabled, we'll skip part requests once the last part index is found\n var nextSnStartIndex = lowLatencyMode ? 0 : lastPartIndex;\n if (hasParts) {\n msn = lastPart ? endSn + 1 : lastPartSn;\n part = lastPart ? nextSnStartIndex : lastPartIndex + 1;\n } else {\n msn = endSn + 1;\n }\n // Low-Latency CDN Tune-in: \"age\" header and time since load indicates we're behind by more than one part\n // Update directives to obtain the Playlist that has the estimated additional duration of media\n var lastAdvanced = details.age;\n var cdnAge = lastAdvanced + details.ageHeader;\n var currentGoal = Math.min(cdnAge - details.partTarget, details.targetduration * 1.5);\n if (currentGoal > 0) {\n if (previousDetails && currentGoal > previousDetails.tuneInGoal) {\n // If we attempted to get the next or latest playlist update, but currentGoal increased,\n // then we either can't catchup, or the \"age\" header cannot be trusted.\n this.warn(\"CDN Tune-in goal increased from: \" + previousDetails.tuneInGoal + \" to: \" + currentGoal + \" with playlist age: \" + details.age);\n currentGoal = 0;\n } else {\n var segments = Math.floor(currentGoal / details.targetduration);\n msn += segments;\n if (part !== undefined) {\n var parts = Math.round(currentGoal % details.targetduration / details.partTarget);\n part += parts;\n }\n this.log(\"CDN Tune-in age: \" + details.ageHeader + \"s last advanced \" + lastAdvanced.toFixed(2) + \"s goal: \" + currentGoal + \" skip sn \" + segments + \" to part \" + part);\n }\n details.tuneInGoal = currentGoal;\n }\n deliveryDirectives = this.getDeliveryDirectives(details, data.deliveryDirectives, msn, part);\n if (lowLatencyMode || !lastPart) {\n this.loadPlaylist(deliveryDirectives);\n return;\n }\n } else {\n deliveryDirectives = this.getDeliveryDirectives(details, data.deliveryDirectives, msn, part);\n }\n var bufferInfo = this.hls.mainForwardBufferInfo;\n var position = bufferInfo ? bufferInfo.end - bufferInfo.len : 0;\n var distanceToLiveEdgeMs = (details.edge - position) * 1000;\n var reloadInterval = (0,_level_helper__WEBPACK_IMPORTED_MODULE_1__.computeReloadInterval)(details, distanceToLiveEdgeMs);\n if (!details.updated) {\n this.requestScheduled = -1;\n } else if (now > this.requestScheduled + reloadInterval) {\n this.requestScheduled = stats.loading.start;\n }\n if (msn !== undefined && details.canBlockReload) {\n this.requestScheduled = stats.loading.first + reloadInterval - (details.partTarget * 1000 || 1000);\n } else {\n this.requestScheduled = (this.requestScheduled === -1 ? now : this.requestScheduled) + reloadInterval;\n }\n var estimatedTimeUntilUpdate = this.requestScheduled - now;\n estimatedTimeUntilUpdate = Math.max(0, estimatedTimeUntilUpdate);\n this.log(\"reload live playlist \" + index + \" in \" + Math.round(estimatedTimeUntilUpdate) + \" ms\");\n // this.log(\n // `live reload ${details.updated ? 'REFRESHED' : 'MISSED'}\n // reload in ${estimatedTimeUntilUpdate / 1000}\n // round trip ${(stats.loading.end - stats.loading.start) / 1000}\n // diff ${\n // (reloadInterval -\n // (estimatedTimeUntilUpdate + stats.loading.end - stats.loading.start)) /\n // 1000\n // }\n // reload interval ${reloadInterval / 1000}\n // target duration ${details.targetduration}\n // distance to edge ${distanceToLiveEdgeMs / 1000}`\n // );\n\n this.timer = self.setTimeout(function () {\n return _this.loadPlaylist(deliveryDirectives);\n }, estimatedTimeUntilUpdate);\n } else {\n this.clearTimer();\n }\n };\n _proto.getDeliveryDirectives = function getDeliveryDirectives(details, previousDeliveryDirectives, msn, part) {\n var skip = (0,_types_level__WEBPACK_IMPORTED_MODULE_0__.getSkipValue)(details, msn);\n if (previousDeliveryDirectives !== null && previousDeliveryDirectives !== void 0 && previousDeliveryDirectives.skip && details.deltaUpdateFailed) {\n msn = previousDeliveryDirectives.msn;\n part = previousDeliveryDirectives.part;\n skip = _types_level__WEBPACK_IMPORTED_MODULE_0__.HlsSkip.No;\n }\n return new _types_level__WEBPACK_IMPORTED_MODULE_0__.HlsUrlParameters(msn, part, skip);\n };\n _proto.retryLoadingOrFail = function retryLoadingOrFail(errorEvent) {\n var _this2 = this;\n var config = this.hls.config;\n var retry = this.retryCount < config.levelLoadingMaxRetry;\n if (retry) {\n var _errorEvent$context;\n this.requestScheduled = -1;\n this.retryCount++;\n if (errorEvent.details.indexOf('LoadTimeOut') > -1 && (_errorEvent$context = errorEvent.context) !== null && _errorEvent$context !== void 0 && _errorEvent$context.deliveryDirectives) {\n // The LL-HLS request already timed out so retry immediately\n this.warn(\"retry playlist loading #\" + this.retryCount + \" after \\\"\" + errorEvent.details + \"\\\"\");\n this.loadPlaylist();\n } else {\n // exponential backoff capped to max retry timeout\n var delay = Math.min(Math.pow(2, this.retryCount) * config.levelLoadingRetryDelay, config.levelLoadingMaxRetryTimeout);\n // Schedule level/track reload\n this.timer = self.setTimeout(function () {\n return _this2.loadPlaylist();\n }, delay);\n this.warn(\"retry playlist loading #\" + this.retryCount + \" in \" + delay + \" ms after \\\"\" + errorEvent.details + \"\\\"\");\n }\n } else {\n this.warn(\"cannot recover from error \\\"\" + errorEvent.details + \"\\\"\");\n // stopping live reloading timer if any\n this.clearTimer();\n // switch error to fatal\n errorEvent.fatal = true;\n }\n return retry;\n };\n return BasePlaylistController;\n}();\n\n\n/***/ }),\n\n/***/ \"./src/controller/base-stream-controller.ts\":\n/*!**************************************************!*\\\n !*** ./src/controller/base-stream-controller.ts ***!\n \\**************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"State\": () => (/* binding */ State),\n/* harmony export */ \"default\": () => (/* binding */ BaseStreamController)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _task_loop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../task-loop */ \"./src/task-loop.ts\");\n/* harmony import */ var _fragment_tracker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fragment-tracker */ \"./src/controller/fragment-tracker.ts\");\n/* harmony import */ var _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/buffer-helper */ \"./src/utils/buffer-helper.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _types_transmuxer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../types/transmuxer */ \"./src/types/transmuxer.ts\");\n/* harmony import */ var _utils_mp4_tools__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/mp4-tools */ \"./src/utils/mp4-tools.ts\");\n/* harmony import */ var _utils_discontinuities__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/discontinuities */ \"./src/utils/discontinuities.ts\");\n/* harmony import */ var _fragment_finders__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./fragment-finders */ \"./src/controller/fragment-finders.ts\");\n/* harmony import */ var _level_helper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./level-helper */ \"./src/controller/level-helper.ts\");\n/* harmony import */ var _loader_fragment_loader__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../loader/fragment-loader */ \"./src/loader/fragment-loader.ts\");\n/* harmony import */ var _crypt_decrypter__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../crypt/decrypter */ \"./src/crypt/decrypter.ts\");\n/* harmony import */ var _utils_time_ranges__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utils/time-ranges */ \"./src/utils/time-ranges.ts\");\n/* harmony import */ var _types_loader__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../types/loader */ \"./src/types/loader.ts\");\n\n\n\n\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar State = {\n STOPPED: 'STOPPED',\n IDLE: 'IDLE',\n KEY_LOADING: 'KEY_LOADING',\n FRAG_LOADING: 'FRAG_LOADING',\n FRAG_LOADING_WAITING_RETRY: 'FRAG_LOADING_WAITING_RETRY',\n WAITING_TRACK: 'WAITING_TRACK',\n PARSING: 'PARSING',\n PARSED: 'PARSED',\n ENDED: 'ENDED',\n ERROR: 'ERROR',\n WAITING_INIT_PTS: 'WAITING_INIT_PTS',\n WAITING_LEVEL: 'WAITING_LEVEL'\n};\nvar BaseStreamController = /*#__PURE__*/function (_TaskLoop) {\n _inheritsLoose(BaseStreamController, _TaskLoop);\n function BaseStreamController(hls, fragmentTracker, keyLoader, logPrefix) {\n var _this;\n _this = _TaskLoop.call(this) || this;\n _this.hls = void 0;\n _this.fragPrevious = null;\n _this.fragCurrent = null;\n _this.fragmentTracker = void 0;\n _this.transmuxer = null;\n _this._state = State.STOPPED;\n _this.media = null;\n _this.mediaBuffer = null;\n _this.config = void 0;\n _this.bitrateTest = false;\n _this.lastCurrentTime = 0;\n _this.nextLoadPosition = 0;\n _this.startPosition = 0;\n _this.loadedmetadata = false;\n _this.fragLoadError = 0;\n _this.retryDate = 0;\n _this.levels = null;\n _this.fragmentLoader = void 0;\n _this.keyLoader = void 0;\n _this.levelLastLoaded = null;\n _this.startFragRequested = false;\n _this.decrypter = void 0;\n _this.initPTS = [];\n _this.onvseeking = null;\n _this.onvended = null;\n _this.logPrefix = '';\n _this.log = void 0;\n _this.warn = void 0;\n _this.logPrefix = logPrefix;\n _this.log = _utils_logger__WEBPACK_IMPORTED_MODULE_4__.logger.log.bind(_utils_logger__WEBPACK_IMPORTED_MODULE_4__.logger, logPrefix + \":\");\n _this.warn = _utils_logger__WEBPACK_IMPORTED_MODULE_4__.logger.warn.bind(_utils_logger__WEBPACK_IMPORTED_MODULE_4__.logger, logPrefix + \":\");\n _this.hls = hls;\n _this.fragmentLoader = new _loader_fragment_loader__WEBPACK_IMPORTED_MODULE_12__[\"default\"](hls.config);\n _this.keyLoader = keyLoader;\n _this.fragmentTracker = fragmentTracker;\n _this.config = hls.config;\n _this.decrypter = new _crypt_decrypter__WEBPACK_IMPORTED_MODULE_13__[\"default\"](hls.config);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_5__.Events.LEVEL_SWITCHING, _this.onLevelSwitching, _assertThisInitialized(_this));\n return _this;\n }\n var _proto = BaseStreamController.prototype;\n _proto.doTick = function doTick() {\n this.onTickEnd();\n };\n _proto.onTickEnd = function onTickEnd() {}\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ;\n _proto.startLoad = function startLoad(startPosition) {};\n _proto.stopLoad = function stopLoad() {\n this.fragmentLoader.abort();\n this.keyLoader.abort();\n var frag = this.fragCurrent;\n if (frag) {\n frag.abortRequests();\n this.fragmentTracker.removeFragment(frag);\n }\n this.resetTransmuxer();\n this.fragCurrent = null;\n this.fragPrevious = null;\n this.clearInterval();\n this.clearNextTick();\n this.state = State.STOPPED;\n };\n _proto._streamEnded = function _streamEnded(bufferInfo, levelDetails) {\n // If playlist is live, there is another buffered range after the current range, nothing buffered, media is detached,\n // of nothing loading/loaded return false\n if (levelDetails.live || bufferInfo.nextStart || !bufferInfo.end || !this.media) {\n return false;\n }\n var partList = levelDetails.partList;\n // Since the last part isn't guaranteed to correspond to the last playlist segment for Low-Latency HLS,\n // check instead if the last part is buffered.\n if (partList !== null && partList !== void 0 && partList.length) {\n var lastPart = partList[partList.length - 1];\n\n // Checking the midpoint of the part for potential margin of error and related issues.\n // NOTE: Technically I believe parts could yield content that is < the computed duration (including potential a duration of 0)\n // and still be spec-compliant, so there may still be edge cases here. Likewise, there could be issues in end of stream\n // part mismatches for independent audio and video playlists/segments.\n var lastPartBuffered = _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_3__.BufferHelper.isBuffered(this.media, lastPart.start + lastPart.duration / 2);\n return lastPartBuffered;\n }\n var playlistType = levelDetails.fragments[levelDetails.fragments.length - 1].type;\n return this.fragmentTracker.isEndListAppended(playlistType);\n };\n _proto.getLevelDetails = function getLevelDetails() {\n if (this.levels && this.levelLastLoaded !== null) {\n var _this$levels$this$lev;\n return (_this$levels$this$lev = this.levels[this.levelLastLoaded]) === null || _this$levels$this$lev === void 0 ? void 0 : _this$levels$this$lev.details;\n }\n };\n _proto.onMediaAttached = function onMediaAttached(event, data) {\n var media = this.media = this.mediaBuffer = data.media;\n this.onvseeking = this.onMediaSeeking.bind(this);\n this.onvended = this.onMediaEnded.bind(this);\n media.addEventListener('seeking', this.onvseeking);\n media.addEventListener('ended', this.onvended);\n var config = this.config;\n if (this.levels && config.autoStartLoad && this.state === State.STOPPED) {\n this.startLoad(config.startPosition);\n }\n };\n _proto.onMediaDetaching = function onMediaDetaching() {\n var media = this.media;\n if (media !== null && media !== void 0 && media.ended) {\n this.log('MSE detaching and video ended, reset startPosition');\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n // remove video listeners\n if (media && this.onvseeking && this.onvended) {\n media.removeEventListener('seeking', this.onvseeking);\n media.removeEventListener('ended', this.onvended);\n this.onvseeking = this.onvended = null;\n }\n if (this.keyLoader) {\n this.keyLoader.detach();\n }\n this.media = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.fragmentTracker.removeAllFragments();\n this.stopLoad();\n };\n _proto.onMediaSeeking = function onMediaSeeking() {\n var config = this.config,\n fragCurrent = this.fragCurrent,\n media = this.media,\n mediaBuffer = this.mediaBuffer,\n state = this.state;\n var currentTime = media ? media.currentTime : 0;\n var bufferInfo = _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_3__.BufferHelper.bufferInfo(mediaBuffer ? mediaBuffer : media, currentTime, config.maxBufferHole);\n this.log(\"media seeking to \" + ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(currentTime) ? currentTime.toFixed(3) : currentTime) + \", state: \" + state);\n if (this.state === State.ENDED) {\n this.resetLoadingState();\n } else if (fragCurrent) {\n // Seeking while frag load is in progress\n var tolerance = config.maxFragLookUpTolerance;\n var fragStartOffset = fragCurrent.start - tolerance;\n var fragEndOffset = fragCurrent.start + fragCurrent.duration + tolerance;\n // if seeking out of buffered range or into new one\n if (!bufferInfo.len || fragEndOffset < bufferInfo.start || fragStartOffset > bufferInfo.end) {\n var pastFragment = currentTime > fragEndOffset;\n // if the seek position is outside the current fragment range\n if (currentTime < fragStartOffset || pastFragment) {\n if (pastFragment && fragCurrent.loader) {\n this.log('seeking outside of buffer while fragment load in progress, cancel fragment load');\n fragCurrent.abortRequests();\n }\n this.resetLoadingState();\n }\n }\n }\n if (media) {\n this.lastCurrentTime = currentTime;\n }\n\n // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target\n if (!this.loadedmetadata && !bufferInfo.len) {\n this.nextLoadPosition = this.startPosition = currentTime;\n }\n\n // Async tick to speed up processing\n this.tickImmediate();\n };\n _proto.onMediaEnded = function onMediaEnded() {\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n };\n _proto.onLevelSwitching = function onLevelSwitching(event, data) {\n this.fragLoadError = 0;\n };\n _proto.onHandlerDestroying = function onHandlerDestroying() {\n this.stopLoad();\n _TaskLoop.prototype.onHandlerDestroying.call(this);\n };\n _proto.onHandlerDestroyed = function onHandlerDestroyed() {\n this.state = State.STOPPED;\n this.hls.off(_events__WEBPACK_IMPORTED_MODULE_5__.Events.LEVEL_SWITCHING, this.onLevelSwitching, this);\n if (this.fragmentLoader) {\n this.fragmentLoader.destroy();\n }\n if (this.keyLoader) {\n this.keyLoader.destroy();\n }\n if (this.decrypter) {\n this.decrypter.destroy();\n }\n this.hls = this.log = this.warn = this.decrypter = this.keyLoader = this.fragmentLoader = this.fragmentTracker = null;\n _TaskLoop.prototype.onHandlerDestroyed.call(this);\n };\n _proto.loadFragment = function loadFragment(frag, levelDetails, targetBufferTime) {\n this._loadFragForPlayback(frag, levelDetails, targetBufferTime);\n };\n _proto._loadFragForPlayback = function _loadFragForPlayback(frag, levelDetails, targetBufferTime) {\n var _this2 = this;\n var progressCallback = function progressCallback(data) {\n if (_this2.fragContextChanged(frag)) {\n _this2.warn(\"Fragment \" + frag.sn + (data.part ? ' p: ' + data.part.index : '') + \" of level \" + frag.level + \" was dropped during download.\");\n _this2.fragmentTracker.removeFragment(frag);\n return;\n }\n frag.stats.chunkCount++;\n _this2._handleFragmentLoadProgress(data);\n };\n this._doFragLoad(frag, levelDetails, targetBufferTime, progressCallback).then(function (data) {\n if (!data) {\n // if we're here we probably needed to backtrack or are waiting for more parts\n return;\n }\n _this2.fragLoadError = 0;\n var state = _this2.state;\n if (_this2.fragContextChanged(frag)) {\n if (state === State.FRAG_LOADING || !_this2.fragCurrent && state === State.PARSING) {\n _this2.fragmentTracker.removeFragment(frag);\n _this2.state = State.IDLE;\n }\n return;\n }\n if ('payload' in data) {\n _this2.log(\"Loaded fragment \" + frag.sn + \" of level \" + frag.level);\n _this2.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.FRAG_LOADED, data);\n }\n\n // Pass through the whole payload; controllers not implementing progressive loading receive data from this callback\n _this2._handleFragmentLoadComplete(data);\n }).catch(function (reason) {\n if (_this2.state === State.STOPPED || _this2.state === State.ERROR) {\n return;\n }\n _this2.warn(reason);\n _this2.resetFragmentLoading(frag);\n });\n };\n _proto.flushMainBuffer = function flushMainBuffer(startOffset, endOffset, type) {\n if (type === void 0) {\n type = null;\n }\n if (!(startOffset - endOffset)) {\n return;\n }\n // When alternate audio is playing, the audio-stream-controller is responsible for the audio buffer. Otherwise,\n // passing a null type flushes both buffers\n var flushScope = {\n startOffset: startOffset,\n endOffset: endOffset,\n type: type\n };\n // Reset load errors on flush\n this.fragLoadError = 0;\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.BUFFER_FLUSHING, flushScope);\n };\n _proto._loadInitSegment = function _loadInitSegment(frag, details) {\n var _this3 = this;\n this._doFragLoad(frag, details).then(function (data) {\n if (!data || _this3.fragContextChanged(frag) || !_this3.levels) {\n throw new Error('init load aborted');\n }\n return data;\n }).then(function (data) {\n var hls = _this3.hls;\n var payload = data.payload;\n var decryptData = frag.decryptdata;\n\n // check to see if the payload needs to be decrypted\n if (payload && payload.byteLength > 0 && decryptData && decryptData.key && decryptData.iv && decryptData.method === 'AES-128') {\n var startTime = self.performance.now();\n // decrypt the subtitles\n return _this3.decrypter.decrypt(new Uint8Array(payload), decryptData.key.buffer, decryptData.iv.buffer).then(function (decryptedData) {\n var endTime = self.performance.now();\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.FRAG_DECRYPTED, {\n frag: frag,\n payload: decryptedData,\n stats: {\n tstart: startTime,\n tdecrypt: endTime\n }\n });\n data.payload = decryptedData;\n return data;\n });\n }\n return data;\n }).then(function (data) {\n var fragCurrent = _this3.fragCurrent,\n hls = _this3.hls,\n levels = _this3.levels;\n if (!levels) {\n throw new Error('init load aborted, missing levels');\n }\n var details = levels[frag.level].details;\n console.assert(details, 'Level details are defined when init segment is loaded');\n var stats = frag.stats;\n _this3.state = State.IDLE;\n _this3.fragLoadError = 0;\n frag.data = new Uint8Array(data.payload);\n stats.parsing.start = stats.buffering.start = self.performance.now();\n stats.parsing.end = stats.buffering.end = self.performance.now();\n\n // Silence FRAG_BUFFERED event if fragCurrent is null\n if (data.frag === fragCurrent) {\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.FRAG_BUFFERED, {\n stats: stats,\n frag: fragCurrent,\n part: null,\n id: frag.type\n });\n }\n _this3.tick();\n }).catch(function (reason) {\n if (_this3.state === State.STOPPED || _this3.state === State.ERROR) {\n return;\n }\n _this3.warn(reason);\n _this3.resetFragmentLoading(frag);\n });\n };\n _proto.fragContextChanged = function fragContextChanged(frag) {\n var fragCurrent = this.fragCurrent;\n return !frag || !fragCurrent || frag.level !== fragCurrent.level || frag.sn !== fragCurrent.sn || frag.urlId !== fragCurrent.urlId;\n };\n _proto.fragBufferedComplete = function fragBufferedComplete(frag, part) {\n var _frag$startPTS, _frag$endPTS, _this$fragCurrent, _this$fragPrevious;\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n this.log(\"Buffered \" + frag.type + \" sn: \" + frag.sn + (part ? ' part: ' + part.index : '') + \" of \" + (this.logPrefix === '[stream-controller]' ? 'level' : 'track') + \" \" + frag.level + \" (frag:[\" + ((_frag$startPTS = frag.startPTS) != null ? _frag$startPTS : NaN).toFixed(3) + \"-\" + ((_frag$endPTS = frag.endPTS) != null ? _frag$endPTS : NaN).toFixed(3) + \"] > buffer:\" + (media ? _utils_time_ranges__WEBPACK_IMPORTED_MODULE_14__[\"default\"].toString(_utils_buffer_helper__WEBPACK_IMPORTED_MODULE_3__.BufferHelper.getBuffered(media)) : '(detached)') + \")\");\n this.state = State.IDLE;\n if (!media) {\n return;\n }\n if (!this.loadedmetadata && frag.type == _types_loader__WEBPACK_IMPORTED_MODULE_15__.PlaylistLevelType.MAIN && media.buffered.length && ((_this$fragCurrent = this.fragCurrent) === null || _this$fragCurrent === void 0 ? void 0 : _this$fragCurrent.sn) === ((_this$fragPrevious = this.fragPrevious) === null || _this$fragPrevious === void 0 ? void 0 : _this$fragPrevious.sn)) {\n this.loadedmetadata = true;\n this.seekToStartPos();\n }\n this.tick();\n };\n _proto.seekToStartPos = function seekToStartPos() {};\n _proto._handleFragmentLoadComplete = function _handleFragmentLoadComplete(fragLoadedEndData) {\n var transmuxer = this.transmuxer;\n if (!transmuxer) {\n return;\n }\n var frag = fragLoadedEndData.frag,\n part = fragLoadedEndData.part,\n partsLoaded = fragLoadedEndData.partsLoaded;\n // If we did not load parts, or loaded all parts, we have complete (not partial) fragment data\n var complete = !partsLoaded || partsLoaded.length === 0 || partsLoaded.some(function (fragLoaded) {\n return !fragLoaded;\n });\n var chunkMeta = new _types_transmuxer__WEBPACK_IMPORTED_MODULE_7__.ChunkMetadata(frag.level, frag.sn, frag.stats.chunkCount + 1, 0, part ? part.index : -1, !complete);\n transmuxer.flush(chunkMeta);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ;\n _proto._handleFragmentLoadProgress = function _handleFragmentLoadProgress(frag) {};\n _proto._doFragLoad = function _doFragLoad(frag, details, targetBufferTime, progressCallback) {\n var _frag$decryptdata,\n _this4 = this;\n if (targetBufferTime === void 0) {\n targetBufferTime = null;\n }\n if (!this.levels) {\n throw new Error('frag load aborted, missing levels');\n }\n var keyLoadingPromise = null;\n if (frag.encrypted && !((_frag$decryptdata = frag.decryptdata) !== null && _frag$decryptdata !== void 0 && _frag$decryptdata.key)) {\n this.log(\"Loading key for \" + frag.sn + \" of [\" + details.startSN + \"-\" + details.endSN + \"], \" + (this.logPrefix === '[stream-controller]' ? 'level' : 'track') + \" \" + frag.level);\n this.state = State.KEY_LOADING;\n this.fragCurrent = frag;\n keyLoadingPromise = this.keyLoader.load(frag).then(function (keyLoadedData) {\n if (!_this4.fragContextChanged(keyLoadedData.frag)) {\n _this4.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.KEY_LOADED, keyLoadedData);\n if (_this4.state === State.KEY_LOADING) {\n _this4.state = State.IDLE;\n }\n return keyLoadedData;\n }\n });\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.KEY_LOADING, {\n frag: frag\n });\n this.throwIfFragContextChanged('KEY_LOADING');\n } else if (!frag.encrypted && details.encryptedFragments.length) {\n this.keyLoader.loadClear(frag, details.encryptedFragments);\n }\n targetBufferTime = Math.max(frag.start, targetBufferTime || 0);\n if (this.config.lowLatencyMode && details) {\n var partList = details.partList;\n if (partList && progressCallback) {\n if (targetBufferTime > frag.end && details.fragmentHint) {\n frag = details.fragmentHint;\n }\n var partIndex = this.getNextPart(partList, frag, targetBufferTime);\n if (partIndex > -1) {\n var part = partList[partIndex];\n this.log(\"Loading part sn: \" + frag.sn + \" p: \" + part.index + \" cc: \" + frag.cc + \" of playlist [\" + details.startSN + \"-\" + details.endSN + \"] parts [0-\" + partIndex + \"-\" + (partList.length - 1) + \"] \" + (this.logPrefix === '[stream-controller]' ? 'level' : 'track') + \": \" + frag.level + \", target: \" + parseFloat(targetBufferTime.toFixed(3)));\n this.nextLoadPosition = part.start + part.duration;\n this.state = State.FRAG_LOADING;\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.FRAG_LOADING, {\n frag: frag,\n part: partList[partIndex],\n targetBufferTime: targetBufferTime\n });\n this.throwIfFragContextChanged('FRAG_LOADING parts');\n if (keyLoadingPromise) {\n return keyLoadingPromise.then(function (keyLoadedData) {\n if (!keyLoadedData || _this4.fragContextChanged(keyLoadedData.frag)) {\n return null;\n }\n return _this4.doFragPartsLoad(frag, partList, partIndex, progressCallback);\n }).catch(function (error) {\n return _this4.handleFragLoadError(error);\n });\n }\n return this.doFragPartsLoad(frag, partList, partIndex, progressCallback).catch(function (error) {\n return _this4.handleFragLoadError(error);\n });\n } else if (!frag.url || this.loadedEndOfParts(partList, targetBufferTime)) {\n // Fragment hint has no parts\n return Promise.resolve(null);\n }\n }\n }\n this.log(\"Loading fragment \" + frag.sn + \" cc: \" + frag.cc + \" \" + (details ? 'of [' + details.startSN + '-' + details.endSN + '] ' : '') + (this.logPrefix === '[stream-controller]' ? 'level' : 'track') + \": \" + frag.level + \", target: \" + parseFloat(targetBufferTime.toFixed(3)));\n // Don't update nextLoadPosition for fragments which are not buffered\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(frag.sn) && !this.bitrateTest) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\n this.state = State.FRAG_LOADING;\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.FRAG_LOADING, {\n frag: frag,\n targetBufferTime: targetBufferTime\n });\n this.throwIfFragContextChanged('FRAG_LOADING');\n\n // Load key before streaming fragment data\n var dataOnProgress = this.config.progressive;\n if (dataOnProgress && keyLoadingPromise) {\n return keyLoadingPromise.then(function (keyLoadedData) {\n if (!keyLoadedData || _this4.fragContextChanged(keyLoadedData === null || keyLoadedData === void 0 ? void 0 : keyLoadedData.frag)) {\n return null;\n }\n return _this4.fragmentLoader.load(frag, progressCallback);\n }).catch(function (error) {\n return _this4.handleFragLoadError(error);\n });\n }\n\n // load unencrypted fragment data with progress event,\n // or handle fragment result after key and fragment are finished loading\n return Promise.all([this.fragmentLoader.load(frag, dataOnProgress ? progressCallback : undefined), keyLoadingPromise]).then(function (_ref) {\n var fragLoadedData = _ref[0];\n if (!dataOnProgress && fragLoadedData && progressCallback) {\n progressCallback(fragLoadedData);\n }\n return fragLoadedData;\n }).catch(function (error) {\n return _this4.handleFragLoadError(error);\n });\n };\n _proto.throwIfFragContextChanged = function throwIfFragContextChanged(context) {\n // exit if context changed during event loop\n if (this.fragCurrent === null) {\n throw new Error(\"frag load aborted, context changed in \" + context);\n }\n };\n _proto.doFragPartsLoad = function doFragPartsLoad(frag, partList, partIndex, progressCallback) {\n var _this5 = this;\n return new Promise(function (resolve, reject) {\n var partsLoaded = [];\n var loadPartIndex = function loadPartIndex(index) {\n var part = partList[index];\n _this5.fragmentLoader.loadPart(frag, part, progressCallback).then(function (partLoadedData) {\n partsLoaded[part.index] = partLoadedData;\n var loadedPart = partLoadedData.part;\n _this5.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.FRAG_LOADED, partLoadedData);\n var nextPart = partList[index + 1];\n if (nextPart && nextPart.fragment === frag) {\n loadPartIndex(index + 1);\n } else {\n return resolve({\n frag: frag,\n part: loadedPart,\n partsLoaded: partsLoaded\n });\n }\n }).catch(reject);\n };\n loadPartIndex(partIndex);\n });\n };\n _proto.handleFragLoadError = function handleFragLoadError(error) {\n if ('data' in error) {\n var data = error.data;\n if (error.data && data.details === _errors__WEBPACK_IMPORTED_MODULE_6__.ErrorDetails.INTERNAL_ABORTED) {\n this.handleFragLoadAborted(data.frag, data.part);\n } else {\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.ERROR, data);\n }\n } else {\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_6__.ErrorTypes.OTHER_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_6__.ErrorDetails.INTERNAL_EXCEPTION,\n err: error,\n fatal: true\n });\n }\n return null;\n };\n _proto._handleTransmuxerFlush = function _handleTransmuxerFlush(chunkMeta) {\n var context = this.getCurrentContext(chunkMeta);\n if (!context || this.state !== State.PARSING) {\n if (!this.fragCurrent && this.state !== State.STOPPED && this.state !== State.ERROR) {\n this.state = State.IDLE;\n }\n return;\n }\n var frag = context.frag,\n part = context.part,\n level = context.level;\n var now = self.performance.now();\n frag.stats.parsing.end = now;\n if (part) {\n part.stats.parsing.end = now;\n }\n this.updateLevelTiming(frag, part, level, chunkMeta.partial);\n };\n _proto.getCurrentContext = function getCurrentContext(chunkMeta) {\n var levels = this.levels;\n var levelIndex = chunkMeta.level,\n sn = chunkMeta.sn,\n partIndex = chunkMeta.part;\n if (!levels || !levels[levelIndex]) {\n this.warn(\"Levels object was unset while buffering fragment \" + sn + \" of level \" + levelIndex + \". The current chunk will not be buffered.\");\n return null;\n }\n var level = levels[levelIndex];\n var part = partIndex > -1 ? (0,_level_helper__WEBPACK_IMPORTED_MODULE_11__.getPartWith)(level, sn, partIndex) : null;\n var frag = part ? part.fragment : (0,_level_helper__WEBPACK_IMPORTED_MODULE_11__.getFragmentWithSN)(level, sn, this.fragCurrent);\n if (!frag) {\n return null;\n }\n return {\n frag: frag,\n part: part,\n level: level\n };\n };\n _proto.bufferFragmentData = function bufferFragmentData(data, frag, part, chunkMeta) {\n if (!data || this.state !== State.PARSING) {\n return;\n }\n var data1 = data.data1,\n data2 = data.data2;\n var buffer = data1;\n if (data1 && data2) {\n // Combine the moof + mdat so that we buffer with a single append\n buffer = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_8__.appendUint8Array)(data1, data2);\n }\n if (!buffer || !buffer.length) {\n return;\n }\n var segment = {\n type: data.type,\n frag: frag,\n part: part,\n chunkMeta: chunkMeta,\n parent: frag.type,\n data: buffer\n };\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.BUFFER_APPENDING, segment);\n if (data.dropped && data.independent && !part) {\n // Clear buffer so that we reload previous segments sequentially if required\n this.flushBufferGap(frag);\n }\n };\n _proto.flushBufferGap = function flushBufferGap(frag) {\n var media = this.media;\n if (!media) {\n return;\n }\n // If currentTime is not buffered, clear the back buffer so that we can backtrack as much as needed\n if (!_utils_buffer_helper__WEBPACK_IMPORTED_MODULE_3__.BufferHelper.isBuffered(media, media.currentTime)) {\n this.flushMainBuffer(0, frag.start);\n return;\n }\n // Remove back-buffer without interrupting playback to allow back tracking\n var currentTime = media.currentTime;\n var bufferInfo = _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_3__.BufferHelper.bufferInfo(media, currentTime, 0);\n var fragDuration = frag.duration;\n var segmentFraction = Math.min(this.config.maxFragLookUpTolerance * 2, fragDuration * 0.25);\n var start = Math.max(Math.min(frag.start - segmentFraction, bufferInfo.end - segmentFraction), currentTime + segmentFraction);\n if (frag.start - start > segmentFraction) {\n this.flushMainBuffer(start, frag.start);\n }\n };\n _proto.getFwdBufferInfo = function getFwdBufferInfo(bufferable, type) {\n var config = this.config;\n var pos = this.getLoadPosition();\n if (!(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(pos)) {\n return null;\n }\n var bufferInfo = _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_3__.BufferHelper.bufferInfo(bufferable, pos, config.maxBufferHole);\n // Workaround flaw in getting forward buffer when maxBufferHole is smaller than gap at current pos\n if (bufferInfo.len === 0 && bufferInfo.nextStart !== undefined) {\n var bufferedFragAtPos = this.fragmentTracker.getBufferedFrag(pos, type);\n if (bufferedFragAtPos && bufferInfo.nextStart < bufferedFragAtPos.end) {\n return _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_3__.BufferHelper.bufferInfo(bufferable, pos, Math.max(bufferInfo.nextStart, config.maxBufferHole));\n }\n }\n return bufferInfo;\n };\n _proto.getMaxBufferLength = function getMaxBufferLength(levelBitrate) {\n var config = this.config;\n var maxBufLen;\n if (levelBitrate) {\n maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, config.maxBufferLength);\n } else {\n maxBufLen = config.maxBufferLength;\n }\n return Math.min(maxBufLen, config.maxMaxBufferLength);\n };\n _proto.reduceMaxBufferLength = function reduceMaxBufferLength(threshold) {\n var config = this.config;\n var minLength = threshold || config.maxBufferLength;\n if (config.maxMaxBufferLength >= minLength) {\n // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...\n config.maxMaxBufferLength /= 2;\n this.warn(\"Reduce max buffer length to \" + config.maxMaxBufferLength + \"s\");\n return true;\n }\n return false;\n };\n _proto.getNextFragment = function getNextFragment(pos, levelDetails) {\n var fragments = levelDetails.fragments;\n var fragLen = fragments.length;\n if (!fragLen) {\n return null;\n }\n\n // find fragment index, contiguous with end of buffer position\n var config = this.config;\n var start = fragments[0].start;\n var frag;\n if (levelDetails.live) {\n var initialLiveManifestSize = config.initialLiveManifestSize;\n if (fragLen < initialLiveManifestSize) {\n this.warn(\"Not enough fragments to start playback (have: \" + fragLen + \", need: \" + initialLiveManifestSize + \")\");\n return null;\n }\n // The real fragment start times for a live stream are only known after the PTS range for that level is known.\n // In order to discover the range, we load the best matching fragment for that level and demux it.\n // Do not load using live logic if the starting frag is requested - we want to use getFragmentAtPosition() so that\n // we get the fragment matching that start time\n if (!levelDetails.PTSKnown && !this.startFragRequested && this.startPosition === -1) {\n frag = this.getInitialLiveFragment(levelDetails, fragments);\n this.startPosition = frag ? this.hls.liveSyncPosition || frag.start : pos;\n }\n } else if (pos <= start) {\n // VoD playlist: if loadPosition before start of playlist, load first fragment\n frag = fragments[0];\n }\n\n // If we haven't run into any special cases already, just load the fragment most closely matching the requested position\n if (!frag) {\n var end = config.lowLatencyMode ? levelDetails.partEnd : levelDetails.fragmentEnd;\n frag = this.getFragmentAtPosition(pos, end, levelDetails);\n }\n return this.mapToInitFragWhenRequired(frag);\n };\n _proto.mapToInitFragWhenRequired = function mapToInitFragWhenRequired(frag) {\n // If an initSegment is present, it must be buffered first\n if (frag !== null && frag !== void 0 && frag.initSegment && !(frag !== null && frag !== void 0 && frag.initSegment.data) && !this.bitrateTest) {\n return frag.initSegment;\n }\n return frag;\n };\n _proto.getNextPart = function getNextPart(partList, frag, targetBufferTime) {\n var nextPart = -1;\n var contiguous = false;\n var independentAttrOmitted = true;\n for (var i = 0, len = partList.length; i < len; i++) {\n var part = partList[i];\n independentAttrOmitted = independentAttrOmitted && !part.independent;\n if (nextPart > -1 && targetBufferTime < part.start) {\n break;\n }\n var loaded = part.loaded;\n if (loaded) {\n nextPart = -1;\n } else if ((contiguous || part.independent || independentAttrOmitted) && part.fragment === frag) {\n nextPart = i;\n }\n contiguous = loaded;\n }\n return nextPart;\n };\n _proto.loadedEndOfParts = function loadedEndOfParts(partList, targetBufferTime) {\n var lastPart = partList[partList.length - 1];\n return lastPart && targetBufferTime > lastPart.start && lastPart.loaded;\n }\n\n /*\n This method is used find the best matching first fragment for a live playlist. This fragment is used to calculate the\n \"sliding\" of the playlist, which is its offset from the start of playback. After sliding we can compute the real\n start and end times for each fragment in the playlist (after which this method will not need to be called).\n */;\n _proto.getInitialLiveFragment = function getInitialLiveFragment(levelDetails, fragments) {\n var fragPrevious = this.fragPrevious;\n var frag = null;\n if (fragPrevious) {\n if (levelDetails.hasProgramDateTime) {\n // Prefer using PDT, because it can be accurate enough to choose the correct fragment without knowing the level sliding\n this.log(\"Live playlist, switching playlist, load frag with same PDT: \" + fragPrevious.programDateTime);\n frag = (0,_fragment_finders__WEBPACK_IMPORTED_MODULE_10__.findFragmentByPDT)(fragments, fragPrevious.endProgramDateTime, this.config.maxFragLookUpTolerance);\n }\n if (!frag) {\n // SN does not need to be accurate between renditions, but depending on the packaging it may be so.\n var targetSN = fragPrevious.sn + 1;\n if (targetSN >= levelDetails.startSN && targetSN <= levelDetails.endSN) {\n var fragNext = fragments[targetSN - levelDetails.startSN];\n // Ensure that we're staying within the continuity range, since PTS resets upon a new range\n if (fragPrevious.cc === fragNext.cc) {\n frag = fragNext;\n this.log(\"Live playlist, switching playlist, load frag with next SN: \" + frag.sn);\n }\n }\n // It's important to stay within the continuity range if available; otherwise the fragments in the playlist\n // will have the wrong start times\n if (!frag) {\n frag = (0,_fragment_finders__WEBPACK_IMPORTED_MODULE_10__.findFragWithCC)(fragments, fragPrevious.cc);\n if (frag) {\n this.log(\"Live playlist, switching playlist, load frag with same CC: \" + frag.sn);\n }\n }\n }\n } else {\n // Find a new start fragment when fragPrevious is null\n var liveStart = this.hls.liveSyncPosition;\n if (liveStart !== null) {\n frag = this.getFragmentAtPosition(liveStart, this.bitrateTest ? levelDetails.fragmentEnd : levelDetails.edge, levelDetails);\n }\n }\n return frag;\n }\n\n /*\n This method finds the best matching fragment given the provided position.\n */;\n _proto.getFragmentAtPosition = function getFragmentAtPosition(bufferEnd, end, levelDetails) {\n var config = this.config;\n var fragPrevious = this.fragPrevious;\n var fragments = levelDetails.fragments,\n endSN = levelDetails.endSN;\n var fragmentHint = levelDetails.fragmentHint;\n var tolerance = config.maxFragLookUpTolerance;\n var loadingParts = !!(config.lowLatencyMode && levelDetails.partList && fragmentHint);\n if (loadingParts && fragmentHint && !this.bitrateTest) {\n // Include incomplete fragment with parts at end\n fragments = fragments.concat(fragmentHint);\n endSN = fragmentHint.sn;\n }\n var frag;\n if (bufferEnd < end) {\n var lookupTolerance = bufferEnd > end - tolerance ? 0 : tolerance;\n // Remove the tolerance if it would put the bufferEnd past the actual end of stream\n // Uses buffer and sequence number to calculate switch segment (required if using EXT-X-DISCONTINUITY-SEQUENCE)\n frag = (0,_fragment_finders__WEBPACK_IMPORTED_MODULE_10__.findFragmentByPTS)(fragPrevious, fragments, bufferEnd, lookupTolerance);\n } else {\n // reach end of playlist\n frag = fragments[fragments.length - 1];\n }\n if (frag) {\n var curSNIdx = frag.sn - levelDetails.startSN;\n // Move fragPrevious forward to support forcing the next fragment to load\n // when the buffer catches up to a previously buffered range.\n if (this.fragmentTracker.getState(frag) === _fragment_tracker__WEBPACK_IMPORTED_MODULE_2__.FragmentState.OK) {\n fragPrevious = frag;\n }\n if (fragPrevious && frag.sn === fragPrevious.sn && !loadingParts) {\n // Force the next fragment to load if the previous one was already selected. This can occasionally happen with\n // non-uniform fragment durations\n var sameLevel = fragPrevious && frag.level === fragPrevious.level;\n if (sameLevel) {\n var nextFrag = fragments[curSNIdx + 1];\n if (frag.sn < endSN && this.fragmentTracker.getState(nextFrag) !== _fragment_tracker__WEBPACK_IMPORTED_MODULE_2__.FragmentState.OK) {\n this.log(\"SN \" + frag.sn + \" just loaded, load next one: \" + nextFrag.sn);\n frag = nextFrag;\n } else {\n frag = null;\n }\n }\n }\n }\n return frag;\n };\n _proto.synchronizeToLiveEdge = function synchronizeToLiveEdge(levelDetails) {\n var config = this.config,\n media = this.media;\n if (!media) {\n return;\n }\n var liveSyncPosition = this.hls.liveSyncPosition;\n var currentTime = media.currentTime;\n var start = levelDetails.fragments[0].start;\n var end = levelDetails.edge;\n var withinSlidingWindow = currentTime >= start - config.maxFragLookUpTolerance && currentTime <= end;\n // Continue if we can seek forward to sync position or if current time is outside of sliding window\n if (liveSyncPosition !== null && media.duration > liveSyncPosition && (currentTime < liveSyncPosition || !withinSlidingWindow)) {\n // Continue if buffer is starving or if current time is behind max latency\n var maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount * levelDetails.targetduration;\n if (!withinSlidingWindow && media.readyState < 4 || currentTime < end - maxLatency) {\n if (!this.loadedmetadata) {\n this.nextLoadPosition = liveSyncPosition;\n }\n // Only seek if ready and there is not a significant forward buffer available for playback\n if (media.readyState) {\n this.warn(\"Playback: \" + currentTime.toFixed(3) + \" is located too far from the end of live sliding playlist: \" + end + \", reset currentTime to : \" + liveSyncPosition.toFixed(3));\n media.currentTime = liveSyncPosition;\n }\n }\n }\n };\n _proto.alignPlaylists = function alignPlaylists(details, previousDetails) {\n var levels = this.levels,\n levelLastLoaded = this.levelLastLoaded,\n fragPrevious = this.fragPrevious;\n var lastLevel = levelLastLoaded !== null ? levels[levelLastLoaded] : null;\n\n // FIXME: If not for `shouldAlignOnDiscontinuities` requiring fragPrevious.cc,\n // this could all go in level-helper mergeDetails()\n var length = details.fragments.length;\n if (!length) {\n this.warn(\"No fragments in live playlist\");\n return 0;\n }\n var slidingStart = details.fragments[0].start;\n var firstLevelLoad = !previousDetails;\n var aligned = details.alignedSliding && (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(slidingStart);\n if (firstLevelLoad || !aligned && !slidingStart) {\n (0,_utils_discontinuities__WEBPACK_IMPORTED_MODULE_9__.alignStream)(fragPrevious, lastLevel, details);\n var alignedSlidingStart = details.fragments[0].start;\n this.log(\"Live playlist sliding: \" + alignedSlidingStart.toFixed(2) + \" start-sn: \" + (previousDetails ? previousDetails.startSN : 'na') + \"->\" + details.startSN + \" prev-sn: \" + (fragPrevious ? fragPrevious.sn : 'na') + \" fragments: \" + length);\n return alignedSlidingStart;\n }\n return slidingStart;\n };\n _proto.waitForCdnTuneIn = function waitForCdnTuneIn(details) {\n // Wait for Low-Latency CDN Tune-in to get an updated playlist\n var advancePartLimit = 3;\n return details.live && details.canBlockReload && details.partTarget && details.tuneInGoal > Math.max(details.partHoldBack, details.partTarget * advancePartLimit);\n };\n _proto.setStartPosition = function setStartPosition(details, sliding) {\n // compute start position if set to -1. use it straight away if value is defined\n var startPosition = this.startPosition;\n if (startPosition < sliding) {\n startPosition = -1;\n }\n if (startPosition === -1 || this.lastCurrentTime === -1) {\n // first, check if start time offset has been set in playlist, if yes, use this value\n var startTimeOffset = details.startTimeOffset;\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(startTimeOffset)) {\n startPosition = sliding + startTimeOffset;\n if (startTimeOffset < 0) {\n startPosition += details.totalduration;\n }\n startPosition = Math.min(Math.max(sliding, startPosition), sliding + details.totalduration);\n this.log(\"Start time offset \" + startTimeOffset + \" found in playlist, adjust startPosition to \" + startPosition);\n this.startPosition = startPosition;\n } else if (details.live) {\n // Leave this.startPosition at -1, so that we can use `getInitialLiveFragment` logic when startPosition has\n // not been specified via the config or an as an argument to startLoad (#3736).\n startPosition = this.hls.liveSyncPosition || sliding;\n } else {\n this.startPosition = startPosition = 0;\n }\n this.lastCurrentTime = startPosition;\n }\n this.nextLoadPosition = startPosition;\n };\n _proto.getLoadPosition = function getLoadPosition() {\n var media = this.media;\n // if we have not yet loaded any fragment, start loading from start position\n var pos = 0;\n if (this.loadedmetadata && media) {\n pos = media.currentTime;\n } else if (this.nextLoadPosition) {\n pos = this.nextLoadPosition;\n }\n return pos;\n };\n _proto.handleFragLoadAborted = function handleFragLoadAborted(frag, part) {\n if (this.transmuxer && frag.sn !== 'initSegment' && frag.stats.aborted) {\n this.warn(\"Fragment \" + frag.sn + (part ? ' part' + part.index : '') + \" of level \" + frag.level + \" was aborted\");\n this.resetFragmentLoading(frag);\n }\n };\n _proto.resetFragmentLoading = function resetFragmentLoading(frag) {\n if (!this.fragCurrent || !this.fragContextChanged(frag) && this.state !== State.FRAG_LOADING_WAITING_RETRY) {\n this.state = State.IDLE;\n }\n };\n _proto.onFragmentOrKeyLoadError = function onFragmentOrKeyLoadError(filterType, data) {\n if (data.fatal) {\n this.stopLoad();\n this.state = State.ERROR;\n return;\n }\n var config = this.config;\n if (data.chunkMeta) {\n // Parsing Error: no retries\n var context = this.getCurrentContext(data.chunkMeta);\n if (context) {\n data.frag = context.frag;\n data.levelRetry = true;\n this.fragLoadError = config.fragLoadingMaxRetry;\n }\n }\n var frag = data.frag;\n // Handle frag error related to caller's filterType\n if (!frag || frag.type !== filterType) {\n return;\n }\n var fragCurrent = this.fragCurrent;\n console.assert(fragCurrent && frag.sn === fragCurrent.sn && frag.level === fragCurrent.level && frag.urlId === fragCurrent.urlId, 'Frag load error must match current frag to retry');\n // keep retrying until the limit will be reached\n if (this.fragLoadError + 1 <= config.fragLoadingMaxRetry) {\n if (!this.loadedmetadata) {\n this.startFragRequested = false;\n this.nextLoadPosition = this.startPosition;\n }\n // exponential backoff capped to config.fragLoadingMaxRetryTimeout\n var delay = Math.min(Math.pow(2, this.fragLoadError) * config.fragLoadingRetryDelay, config.fragLoadingMaxRetryTimeout);\n this.warn(\"Fragment \" + frag.sn + \" of \" + filterType + \" \" + frag.level + \" failed to load, retrying in \" + delay + \"ms\");\n this.retryDate = self.performance.now() + delay;\n this.fragLoadError++;\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else if (data.levelRetry) {\n if (filterType === _types_loader__WEBPACK_IMPORTED_MODULE_15__.PlaylistLevelType.AUDIO) {\n // Reset current fragment since audio track audio is essential and may not have a fail-over track\n this.fragCurrent = null;\n }\n // Fragment errors that result in a level switch or redundant fail-over\n // should reset the stream controller state to idle\n this.fragLoadError = 0;\n this.state = State.IDLE;\n } else {\n _utils_logger__WEBPACK_IMPORTED_MODULE_4__.logger.error(data.details + \" reaches max retry, redispatch as fatal ...\");\n // switch error to fatal\n data.fatal = true;\n this.hls.stopLoad();\n this.state = State.ERROR;\n }\n };\n _proto.afterBufferFlushed = function afterBufferFlushed(media, bufferType, playlistType) {\n if (!media) {\n return;\n }\n // After successful buffer flushing, filter flushed fragments from bufferedFrags use mediaBuffered instead of media\n // (so that we will check against video.buffered ranges in case of alt audio track)\n var bufferedTimeRanges = _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_3__.BufferHelper.getBuffered(media);\n this.fragmentTracker.detectEvictedFragments(bufferType, bufferedTimeRanges, playlistType);\n if (this.state === State.ENDED) {\n this.resetLoadingState();\n }\n };\n _proto.resetLoadingState = function resetLoadingState() {\n this.log('Reset loading state');\n this.fragCurrent = null;\n this.fragPrevious = null;\n this.state = State.IDLE;\n };\n _proto.resetStartWhenNotLoaded = function resetStartWhenNotLoaded(level) {\n // if loadedmetadata is not set, it means that first frag request failed\n // in that case, reset startFragRequested flag\n if (!this.loadedmetadata) {\n this.startFragRequested = false;\n var details = this.levels ? this.levels[level].details : null;\n if (details !== null && details !== void 0 && details.live) {\n // Update the start position and return to IDLE to recover live start\n this.startPosition = -1;\n this.setStartPosition(details, 0);\n this.resetLoadingState();\n } else {\n this.nextLoadPosition = this.startPosition;\n }\n }\n };\n _proto.updateLevelTiming = function updateLevelTiming(frag, part, level, partial) {\n var _this6 = this;\n var details = level.details;\n console.assert(!!details, 'level.details must be defined');\n var parsed = Object.keys(frag.elementaryStreams).reduce(function (result, type) {\n var info = frag.elementaryStreams[type];\n if (info) {\n var parsedDuration = info.endPTS - info.startPTS;\n if (parsedDuration <= 0) {\n // Destroy the transmuxer after it's next time offset failed to advance because duration was <= 0.\n // The new transmuxer will be configured with a time offset matching the next fragment start,\n // preventing the timeline from shifting.\n _this6.warn(\"Could not parse fragment \" + frag.sn + \" \" + type + \" duration reliably (\" + parsedDuration + \")\");\n return result || false;\n }\n var drift = partial ? 0 : (0,_level_helper__WEBPACK_IMPORTED_MODULE_11__.updateFragPTSDTS)(details, frag, info.startPTS, info.endPTS, info.startDTS, info.endDTS);\n _this6.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.LEVEL_PTS_UPDATED, {\n details: details,\n level: level,\n drift: drift,\n type: type,\n frag: frag,\n start: info.startPTS,\n end: info.endPTS\n });\n return true;\n }\n return result;\n }, false);\n if (!parsed) {\n this.warn(\"Found no media in fragment \" + frag.sn + \" of level \" + level.id + \" resetting transmuxer to fallback to playlist timing\");\n this.resetTransmuxer();\n }\n this.state = State.PARSED;\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_5__.Events.FRAG_PARSED, {\n frag: frag,\n part: part\n });\n };\n _proto.resetTransmuxer = function resetTransmuxer() {\n if (this.transmuxer) {\n this.transmuxer.destroy();\n this.transmuxer = null;\n }\n };\n _createClass(BaseStreamController, [{\n key: \"state\",\n get: function get() {\n return this._state;\n },\n set: function set(nextState) {\n var previousState = this._state;\n if (previousState !== nextState) {\n this._state = nextState;\n this.log(previousState + \"->\" + nextState);\n }\n }\n }]);\n return BaseStreamController;\n}(_task_loop__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n\n/***/ }),\n\n/***/ \"./src/controller/buffer-controller.ts\":\n/*!*********************************************!*\\\n !*** ./src/controller/buffer-controller.ts ***!\n \\*********************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ BufferController)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/buffer-helper */ \"./src/utils/buffer-helper.ts\");\n/* harmony import */ var _utils_mediasource_helper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/mediasource-helper */ \"./src/utils/mediasource-helper.ts\");\n/* harmony import */ var _loader_fragment__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../loader/fragment */ \"./src/loader/fragment.ts\");\n/* harmony import */ var _buffer_operation_queue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./buffer-operation-queue */ \"./src/controller/buffer-operation-queue.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\nvar MediaSource = (0,_utils_mediasource_helper__WEBPACK_IMPORTED_MODULE_5__.getMediaSource)();\nvar VIDEO_CODEC_PROFILE_REPACE = /([ha]vc.)(?:\\.[^.,]+)+/;\nvar BufferController = /*#__PURE__*/function () {\n // The level details used to determine duration, target-duration and live\n\n // cache the self generated object url to detect hijack of video tag\n\n // A queue of buffer operations which require the SourceBuffer to not be updating upon execution\n\n // References to event listeners for each SourceBuffer, so that they can be referenced for event removal\n\n // The number of BUFFER_CODEC events received before any sourceBuffers are created\n\n // The total number of BUFFER_CODEC events received\n\n // A reference to the attached media element\n\n // A reference to the active media source\n\n // Last MP3 audio chunk appended\n\n // counters\n\n function BufferController(hls) {\n var _this = this;\n this.details = null;\n this._objectUrl = null;\n this.operationQueue = void 0;\n this.listeners = void 0;\n this.hls = void 0;\n this.bufferCodecEventsExpected = 0;\n this._bufferCodecEventsTotal = 0;\n this.media = null;\n this.mediaSource = null;\n this.lastMpegAudioChunk = null;\n this.appendError = 0;\n this.tracks = {};\n this.pendingTracks = {};\n this.sourceBuffer = void 0;\n this._onMediaSourceOpen = function () {\n var media = _this.media,\n mediaSource = _this.mediaSource;\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log('[buffer-controller]: Media source opened');\n if (media) {\n media.removeEventListener('emptied', _this._onMediaEmptied);\n _this.updateMediaElementDuration();\n _this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_ATTACHED, {\n media: media\n });\n }\n if (mediaSource) {\n // once received, don't listen anymore to sourceopen event\n mediaSource.removeEventListener('sourceopen', _this._onMediaSourceOpen);\n }\n _this.checkPendingTracks();\n };\n this._onMediaSourceClose = function () {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log('[buffer-controller]: Media source closed');\n };\n this._onMediaSourceEnded = function () {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log('[buffer-controller]: Media source ended');\n };\n this._onMediaEmptied = function () {\n var media = _this.media,\n _objectUrl = _this._objectUrl;\n if (media && media.src !== _objectUrl) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.error(\"Media element src was set while attaching MediaSource (\" + _objectUrl + \" > \" + media.src + \")\");\n }\n };\n this.hls = hls;\n this._initSourceBuffer();\n this.registerListeners();\n }\n var _proto = BufferController.prototype;\n _proto.hasSourceTypes = function hasSourceTypes() {\n return this.getSourceBufferTypes().length > 0 || Object.keys(this.pendingTracks).length > 0;\n };\n _proto.destroy = function destroy() {\n this.unregisterListeners();\n this.details = null;\n this.lastMpegAudioChunk = null;\n };\n _proto.registerListeners = function registerListeners() {\n var hls = this.hls;\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_ATTACHING, this.onMediaAttaching, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_DETACHING, this.onMediaDetaching, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_PARSED, this.onManifestParsed, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_RESET, this.onBufferReset, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_APPENDING, this.onBufferAppending, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_CODECS, this.onBufferCodecs, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_EOS, this.onBufferEos, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_FLUSHING, this.onBufferFlushing, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_UPDATED, this.onLevelUpdated, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.FRAG_PARSED, this.onFragParsed, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.FRAG_CHANGED, this.onFragChanged, this);\n };\n _proto.unregisterListeners = function unregisterListeners() {\n var hls = this.hls;\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_ATTACHING, this.onMediaAttaching, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_DETACHING, this.onMediaDetaching, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_PARSED, this.onManifestParsed, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_RESET, this.onBufferReset, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_APPENDING, this.onBufferAppending, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_CODECS, this.onBufferCodecs, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_EOS, this.onBufferEos, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_FLUSHING, this.onBufferFlushing, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_UPDATED, this.onLevelUpdated, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.FRAG_PARSED, this.onFragParsed, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.FRAG_CHANGED, this.onFragChanged, this);\n };\n _proto._initSourceBuffer = function _initSourceBuffer() {\n this.sourceBuffer = {};\n this.operationQueue = new _buffer_operation_queue__WEBPACK_IMPORTED_MODULE_7__[\"default\"](this.sourceBuffer);\n this.listeners = {\n audio: [],\n video: [],\n audiovideo: []\n };\n this.lastMpegAudioChunk = null;\n };\n _proto.onManifestParsed = function onManifestParsed(event, data) {\n // in case of alt audio 2 BUFFER_CODECS events will be triggered, one per stream controller\n // sourcebuffers will be created all at once when the expected nb of tracks will be reached\n // in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller\n // it will contain the expected nb of source buffers, no need to compute it\n var codecEvents = 2;\n if (data.audio && !data.video || !data.altAudio) {\n codecEvents = 1;\n }\n this.bufferCodecEventsExpected = this._bufferCodecEventsTotal = codecEvents;\n this.details = null;\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log(this.bufferCodecEventsExpected + \" bufferCodec event(s) expected\");\n };\n _proto.onMediaAttaching = function onMediaAttaching(event, data) {\n var media = this.media = data.media;\n if (media && MediaSource) {\n var ms = this.mediaSource = new MediaSource();\n // MediaSource listeners are arrow functions with a lexical scope, and do not need to be bound\n ms.addEventListener('sourceopen', this._onMediaSourceOpen);\n ms.addEventListener('sourceended', this._onMediaSourceEnded);\n ms.addEventListener('sourceclose', this._onMediaSourceClose);\n // link video and media Source\n media.src = self.URL.createObjectURL(ms);\n // cache the locally generated object url\n this._objectUrl = media.src;\n media.addEventListener('emptied', this._onMediaEmptied);\n }\n };\n _proto.onMediaDetaching = function onMediaDetaching() {\n var media = this.media,\n mediaSource = this.mediaSource,\n _objectUrl = this._objectUrl;\n if (mediaSource) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log('[buffer-controller]: media source detaching');\n if (mediaSource.readyState === 'open') {\n try {\n // endOfStream could trigger exception if any sourcebuffer is in updating state\n // we don't really care about checking sourcebuffer state here,\n // as we are anyway detaching the MediaSource\n // let's just avoid this exception to propagate\n mediaSource.endOfStream();\n } catch (err) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.warn(\"[buffer-controller]: onMediaDetaching: \" + err.message + \" while calling endOfStream\");\n }\n }\n // Clean up the SourceBuffers by invoking onBufferReset\n this.onBufferReset();\n mediaSource.removeEventListener('sourceopen', this._onMediaSourceOpen);\n mediaSource.removeEventListener('sourceended', this._onMediaSourceEnded);\n mediaSource.removeEventListener('sourceclose', this._onMediaSourceClose);\n\n // Detach properly the MediaSource from the HTMLMediaElement as\n // suggested in https://github.com/w3c/media-source/issues/53.\n if (media) {\n media.removeEventListener('emptied', this._onMediaEmptied);\n if (_objectUrl) {\n self.URL.revokeObjectURL(_objectUrl);\n }\n\n // clean up video tag src only if it's our own url. some external libraries might\n // hijack the video tag and change its 'src' without destroying the Hls instance first\n if (media.src === _objectUrl) {\n media.removeAttribute('src');\n media.load();\n } else {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.warn('[buffer-controller]: media.src was changed by a third party - skip cleanup');\n }\n }\n this.mediaSource = null;\n this.media = null;\n this._objectUrl = null;\n this.bufferCodecEventsExpected = this._bufferCodecEventsTotal;\n this.pendingTracks = {};\n this.tracks = {};\n }\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_DETACHED, undefined);\n };\n _proto.onBufferReset = function onBufferReset() {\n var _this2 = this;\n this.getSourceBufferTypes().forEach(function (type) {\n var sb = _this2.sourceBuffer[type];\n try {\n if (sb) {\n _this2.removeBufferListeners(type);\n if (_this2.mediaSource) {\n _this2.mediaSource.removeSourceBuffer(sb);\n }\n // Synchronously remove the SB from the map before the next call in order to prevent an async function from\n // accessing it\n _this2.sourceBuffer[type] = undefined;\n }\n } catch (err) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.warn(\"[buffer-controller]: Failed to reset the \" + type + \" buffer\", err);\n }\n });\n this._initSourceBuffer();\n };\n _proto.onBufferCodecs = function onBufferCodecs(event, data) {\n var _this3 = this;\n var sourceBufferCount = this.getSourceBufferTypes().length;\n Object.keys(data).forEach(function (trackName) {\n if (sourceBufferCount) {\n // check if SourceBuffer codec needs to change\n var track = _this3.tracks[trackName];\n if (track && typeof track.buffer.changeType === 'function') {\n var _data$trackName = data[trackName],\n id = _data$trackName.id,\n codec = _data$trackName.codec,\n levelCodec = _data$trackName.levelCodec,\n container = _data$trackName.container,\n metadata = _data$trackName.metadata;\n var currentCodec = (track.levelCodec || track.codec).replace(VIDEO_CODEC_PROFILE_REPACE, '$1');\n var nextCodec = (levelCodec || codec).replace(VIDEO_CODEC_PROFILE_REPACE, '$1');\n if (currentCodec !== nextCodec) {\n var mimeType = container + \";codecs=\" + (levelCodec || codec);\n _this3.appendChangeType(trackName, mimeType);\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log(\"[buffer-controller]: switching codec \" + currentCodec + \" to \" + nextCodec);\n _this3.tracks[trackName] = {\n buffer: track.buffer,\n codec: codec,\n container: container,\n levelCodec: levelCodec,\n metadata: metadata,\n id: id\n };\n }\n }\n } else {\n // if source buffer(s) not created yet, appended buffer tracks in this.pendingTracks\n _this3.pendingTracks[trackName] = data[trackName];\n }\n });\n\n // if sourcebuffers already created, do nothing ...\n if (sourceBufferCount) {\n return;\n }\n this.bufferCodecEventsExpected = Math.max(this.bufferCodecEventsExpected - 1, 0);\n if (this.mediaSource && this.mediaSource.readyState === 'open') {\n this.checkPendingTracks();\n }\n };\n _proto.appendChangeType = function appendChangeType(type, mimeType) {\n var _this4 = this;\n var operationQueue = this.operationQueue;\n var operation = {\n execute: function execute() {\n var sb = _this4.sourceBuffer[type];\n if (sb) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log(\"[buffer-controller]: changing \" + type + \" sourceBuffer type to \" + mimeType);\n sb.changeType(mimeType);\n }\n operationQueue.shiftAndExecuteNext(type);\n },\n onStart: function onStart() {},\n onComplete: function onComplete() {},\n onError: function onError(e) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.warn(\"[buffer-controller]: Failed to change \" + type + \" SourceBuffer type\", e);\n }\n };\n operationQueue.append(operation, type);\n };\n _proto.onBufferAppending = function onBufferAppending(event, eventData) {\n var _this5 = this;\n var hls = this.hls,\n operationQueue = this.operationQueue,\n tracks = this.tracks;\n var data = eventData.data,\n type = eventData.type,\n frag = eventData.frag,\n part = eventData.part,\n chunkMeta = eventData.chunkMeta;\n var chunkStats = chunkMeta.buffering[type];\n var bufferAppendingStart = self.performance.now();\n chunkStats.start = bufferAppendingStart;\n var fragBuffering = frag.stats.buffering;\n var partBuffering = part ? part.stats.buffering : null;\n if (fragBuffering.start === 0) {\n fragBuffering.start = bufferAppendingStart;\n }\n if (partBuffering && partBuffering.start === 0) {\n partBuffering.start = bufferAppendingStart;\n }\n\n // TODO: Only update timestampOffset when audio/mpeg fragment or part is not contiguous with previously appended\n // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)\n // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`\n // is greater than 100ms (this is enough to handle seek for VOD or level change for LIVE videos).\n // More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486\n var audioTrack = tracks.audio;\n var checkTimestampOffset = false;\n if (type === 'audio' && (audioTrack === null || audioTrack === void 0 ? void 0 : audioTrack.container) === 'audio/mpeg') {\n checkTimestampOffset = !this.lastMpegAudioChunk || chunkMeta.id === 1 || this.lastMpegAudioChunk.sn !== chunkMeta.sn;\n this.lastMpegAudioChunk = chunkMeta;\n }\n var fragStart = frag.start;\n var operation = {\n execute: function execute() {\n chunkStats.executeStart = self.performance.now();\n if (checkTimestampOffset) {\n var sb = _this5.sourceBuffer[type];\n if (sb) {\n var delta = fragStart - sb.timestampOffset;\n if (Math.abs(delta) >= 0.1) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log(\"[buffer-controller]: Updating audio SourceBuffer timestampOffset to \" + fragStart + \" (delta: \" + delta + \") sn: \" + frag.sn + \")\");\n sb.timestampOffset = fragStart;\n }\n }\n }\n _this5.appendExecutor(data, type);\n },\n onStart: function onStart() {\n // logger.debug(`[buffer-controller]: ${type} SourceBuffer updatestart`);\n },\n onComplete: function onComplete() {\n // logger.debug(`[buffer-controller]: ${type} SourceBuffer updateend`);\n var end = self.performance.now();\n chunkStats.executeEnd = chunkStats.end = end;\n if (fragBuffering.first === 0) {\n fragBuffering.first = end;\n }\n if (partBuffering && partBuffering.first === 0) {\n partBuffering.first = end;\n }\n var sourceBuffer = _this5.sourceBuffer;\n var timeRanges = {};\n for (var _type in sourceBuffer) {\n timeRanges[_type] = _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_4__.BufferHelper.getBuffered(sourceBuffer[_type]);\n }\n _this5.appendError = 0;\n _this5.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_APPENDED, {\n type: type,\n frag: frag,\n part: part,\n chunkMeta: chunkMeta,\n parent: frag.type,\n timeRanges: timeRanges\n });\n },\n onError: function onError(err) {\n // in case any error occured while appending, put back segment in segments table\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.error(\"[buffer-controller]: Error encountered while trying to append to the \" + type + \" SourceBuffer\", err);\n var event = {\n type: _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorTypes.MEDIA_ERROR,\n parent: frag.type,\n details: _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorDetails.BUFFER_APPEND_ERROR,\n err: err,\n fatal: false\n };\n if (err.code === DOMException.QUOTA_EXCEEDED_ERR) {\n // QuotaExceededError: http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror\n // let's stop appending any segments, and report BUFFER_FULL_ERROR error\n event.details = _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorDetails.BUFFER_FULL_ERROR;\n } else {\n _this5.appendError++;\n event.details = _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorDetails.BUFFER_APPEND_ERROR;\n /* with UHD content, we could get loop of quota exceeded error until\n browser is able to evict some data from sourcebuffer. Retrying can help recover.\n */\n if (_this5.appendError > hls.config.appendErrorMaxRetry) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.error(\"[buffer-controller]: Failed \" + hls.config.appendErrorMaxRetry + \" times to append segment in sourceBuffer\");\n event.fatal = true;\n hls.stopLoad();\n }\n }\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, event);\n }\n };\n operationQueue.append(operation, type);\n };\n _proto.onBufferFlushing = function onBufferFlushing(event, data) {\n var _this6 = this;\n var operationQueue = this.operationQueue;\n var flushOperation = function flushOperation(type) {\n return {\n execute: _this6.removeExecutor.bind(_this6, type, data.startOffset, data.endOffset),\n onStart: function onStart() {\n // logger.debug(`[buffer-controller]: Started flushing ${data.startOffset} -> ${data.endOffset} for ${type} Source Buffer`);\n },\n onComplete: function onComplete() {\n // logger.debug(`[buffer-controller]: Finished flushing ${data.startOffset} -> ${data.endOffset} for ${type} Source Buffer`);\n _this6.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_FLUSHED, {\n type: type\n });\n },\n onError: function onError(e) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.warn(\"[buffer-controller]: Failed to remove from \" + type + \" SourceBuffer\", e);\n }\n };\n };\n if (data.type) {\n operationQueue.append(flushOperation(data.type), data.type);\n } else {\n this.getSourceBufferTypes().forEach(function (type) {\n operationQueue.append(flushOperation(type), type);\n });\n }\n };\n _proto.onFragParsed = function onFragParsed(event, data) {\n var _this7 = this;\n var frag = data.frag,\n part = data.part;\n var buffersAppendedTo = [];\n var elementaryStreams = part ? part.elementaryStreams : frag.elementaryStreams;\n if (elementaryStreams[_loader_fragment__WEBPACK_IMPORTED_MODULE_6__.ElementaryStreamTypes.AUDIOVIDEO]) {\n buffersAppendedTo.push('audiovideo');\n } else {\n if (elementaryStreams[_loader_fragment__WEBPACK_IMPORTED_MODULE_6__.ElementaryStreamTypes.AUDIO]) {\n buffersAppendedTo.push('audio');\n }\n if (elementaryStreams[_loader_fragment__WEBPACK_IMPORTED_MODULE_6__.ElementaryStreamTypes.VIDEO]) {\n buffersAppendedTo.push('video');\n }\n }\n var onUnblocked = function onUnblocked() {\n var now = self.performance.now();\n frag.stats.buffering.end = now;\n if (part) {\n part.stats.buffering.end = now;\n }\n var stats = part ? part.stats : frag.stats;\n _this7.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.FRAG_BUFFERED, {\n frag: frag,\n part: part,\n stats: stats,\n id: frag.type\n });\n };\n if (buffersAppendedTo.length === 0) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.warn(\"Fragments must have at least one ElementaryStreamType set. type: \" + frag.type + \" level: \" + frag.level + \" sn: \" + frag.sn);\n }\n this.blockBuffers(onUnblocked, buffersAppendedTo);\n };\n _proto.onFragChanged = function onFragChanged(event, data) {\n this.flushBackBuffer();\n }\n\n // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()\n // an undefined data.type will mark all buffers as EOS.\n ;\n _proto.onBufferEos = function onBufferEos(event, data) {\n var _this8 = this;\n var ended = this.getSourceBufferTypes().reduce(function (acc, type) {\n var sb = _this8.sourceBuffer[type];\n if (sb && (!data.type || data.type === type)) {\n sb.ending = true;\n if (!sb.ended) {\n sb.ended = true;\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log(\"[buffer-controller]: \" + type + \" sourceBuffer now EOS\");\n }\n }\n return acc && !!(!sb || sb.ended);\n }, true);\n if (ended) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log(\"[buffer-controller]: Queueing mediaSource.endOfStream()\");\n this.blockBuffers(function () {\n _this8.getSourceBufferTypes().forEach(function (type) {\n var sb = _this8.sourceBuffer[type];\n if (sb) {\n sb.ending = false;\n }\n });\n var mediaSource = _this8.mediaSource;\n if (!mediaSource || mediaSource.readyState !== 'open') {\n if (mediaSource) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.info(\"[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: \" + mediaSource.readyState);\n }\n return;\n }\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log(\"[buffer-controller]: Calling mediaSource.endOfStream()\");\n // Allow this to throw and be caught by the enqueueing function\n mediaSource.endOfStream();\n });\n }\n };\n _proto.onLevelUpdated = function onLevelUpdated(event, _ref) {\n var details = _ref.details;\n if (!details.fragments.length) {\n return;\n }\n this.details = details;\n if (this.getSourceBufferTypes().length) {\n this.blockBuffers(this.updateMediaElementDuration.bind(this));\n } else {\n this.updateMediaElementDuration();\n }\n };\n _proto.flushBackBuffer = function flushBackBuffer() {\n var hls = this.hls,\n details = this.details,\n media = this.media,\n sourceBuffer = this.sourceBuffer;\n if (!media || details === null) {\n return;\n }\n var sourceBufferTypes = this.getSourceBufferTypes();\n if (!sourceBufferTypes.length) {\n return;\n }\n\n // Support for deprecated liveBackBufferLength\n var backBufferLength = details.live && hls.config.liveBackBufferLength !== null ? hls.config.liveBackBufferLength : hls.config.backBufferLength;\n if (!(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(backBufferLength) || backBufferLength < 0) {\n return;\n }\n var currentTime = media.currentTime;\n var targetDuration = details.levelTargetDuration;\n var maxBackBufferLength = Math.max(backBufferLength, targetDuration);\n var targetBackBufferPosition = Math.floor(currentTime / targetDuration) * targetDuration - maxBackBufferLength;\n sourceBufferTypes.forEach(function (type) {\n var sb = sourceBuffer[type];\n if (sb) {\n var buffered = _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_4__.BufferHelper.getBuffered(sb);\n // when target buffer start exceeds actual buffer start\n if (buffered.length > 0 && targetBackBufferPosition > buffered.start(0)) {\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BACK_BUFFER_REACHED, {\n bufferEnd: targetBackBufferPosition\n });\n\n // Support for deprecated event:\n if (details.live) {\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LIVE_BACK_BUFFER_REACHED, {\n bufferEnd: targetBackBufferPosition\n });\n } else if (sb.ended && buffered.end(buffered.length - 1) - currentTime < targetDuration * 2) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.info(\"[buffer-controller]: Cannot flush \" + type + \" back buffer while SourceBuffer is in ended state\");\n return;\n }\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_FLUSHING, {\n startOffset: 0,\n endOffset: targetBackBufferPosition,\n type: type\n });\n }\n }\n });\n }\n\n /**\n * Update Media Source duration to current level duration or override to Infinity if configuration parameter\n * 'liveDurationInfinity` is set to `true`\n * More details: https://github.com/video-dev/hls.js/issues/355\n */;\n _proto.updateMediaElementDuration = function updateMediaElementDuration() {\n if (!this.details || !this.media || !this.mediaSource || this.mediaSource.readyState !== 'open') {\n return;\n }\n var details = this.details,\n hls = this.hls,\n media = this.media,\n mediaSource = this.mediaSource;\n var levelDuration = details.fragments[0].start + details.totalduration;\n var mediaDuration = media.duration;\n var msDuration = (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(mediaSource.duration) ? mediaSource.duration : 0;\n if (details.live && hls.config.liveDurationInfinity) {\n // Override duration to Infinity\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log('[buffer-controller]: Media Source duration is set to Infinity');\n mediaSource.duration = Infinity;\n this.updateSeekableRange(details);\n } else if (levelDuration > msDuration && levelDuration > mediaDuration || !(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(mediaDuration)) {\n // levelDuration was the last value we set.\n // not using mediaSource.duration as the browser may tweak this value\n // only update Media Source duration if its value increase, this is to avoid\n // flushing already buffered portion when switching between quality level\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log(\"[buffer-controller]: Updating Media Source duration to \" + levelDuration.toFixed(3));\n mediaSource.duration = levelDuration;\n }\n };\n _proto.updateSeekableRange = function updateSeekableRange(levelDetails) {\n var mediaSource = this.mediaSource;\n var fragments = levelDetails.fragments;\n var len = fragments.length;\n if (len && levelDetails.live && mediaSource !== null && mediaSource !== void 0 && mediaSource.setLiveSeekableRange) {\n var start = Math.max(0, fragments[0].start);\n var end = Math.max(start, start + levelDetails.totalduration);\n mediaSource.setLiveSeekableRange(start, end);\n }\n };\n _proto.checkPendingTracks = function checkPendingTracks() {\n var bufferCodecEventsExpected = this.bufferCodecEventsExpected,\n operationQueue = this.operationQueue,\n pendingTracks = this.pendingTracks;\n\n // Check if we've received all of the expected bufferCodec events. When none remain, create all the sourceBuffers at once.\n // This is important because the MSE spec allows implementations to throw QuotaExceededErrors if creating new sourceBuffers after\n // data has been appended to existing ones.\n // 2 tracks is the max (one for audio, one for video). If we've reach this max go ahead and create the buffers.\n var pendingTracksCount = Object.keys(pendingTracks).length;\n if (pendingTracksCount && !bufferCodecEventsExpected || pendingTracksCount === 2) {\n // ok, let's create them now !\n this.createSourceBuffers(pendingTracks);\n this.pendingTracks = {};\n // append any pending segments now !\n var buffers = this.getSourceBufferTypes();\n if (buffers.length === 0) {\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,\n fatal: true,\n reason: 'could not create source buffer for media codec(s)'\n });\n return;\n }\n buffers.forEach(function (type) {\n operationQueue.executeNext(type);\n });\n }\n };\n _proto.createSourceBuffers = function createSourceBuffers(tracks) {\n var sourceBuffer = this.sourceBuffer,\n mediaSource = this.mediaSource;\n if (!mediaSource) {\n throw Error('createSourceBuffers called when mediaSource was null');\n }\n var tracksCreated = 0;\n for (var trackName in tracks) {\n if (!sourceBuffer[trackName]) {\n var track = tracks[trackName];\n if (!track) {\n throw Error(\"source buffer exists for track \" + trackName + \", however track does not\");\n }\n // use levelCodec as first priority\n var codec = track.levelCodec || track.codec;\n var mimeType = track.container + \";codecs=\" + codec;\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log(\"[buffer-controller]: creating sourceBuffer(\" + mimeType + \")\");\n try {\n var sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);\n var sbName = trackName;\n this.addBufferListener(sbName, 'updatestart', this._onSBUpdateStart);\n this.addBufferListener(sbName, 'updateend', this._onSBUpdateEnd);\n this.addBufferListener(sbName, 'error', this._onSBUpdateError);\n this.tracks[trackName] = {\n buffer: sb,\n codec: codec,\n container: track.container,\n levelCodec: track.levelCodec,\n metadata: track.metadata,\n id: track.id\n };\n tracksCreated++;\n } catch (err) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.error(\"[buffer-controller]: error while trying to add sourceBuffer: \" + err.message);\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorDetails.BUFFER_ADD_CODEC_ERROR,\n fatal: false,\n error: err,\n mimeType: mimeType\n });\n }\n }\n }\n if (tracksCreated) {\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_CREATED, {\n tracks: this.tracks\n });\n }\n }\n\n // Keep as arrow functions so that we can directly reference these functions directly as event listeners\n ;\n _proto._onSBUpdateStart = function _onSBUpdateStart(type) {\n var operationQueue = this.operationQueue;\n var operation = operationQueue.current(type);\n operation.onStart();\n };\n _proto._onSBUpdateEnd = function _onSBUpdateEnd(type) {\n var operationQueue = this.operationQueue;\n var operation = operationQueue.current(type);\n operation.onComplete();\n operationQueue.shiftAndExecuteNext(type);\n };\n _proto._onSBUpdateError = function _onSBUpdateError(type, event) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.error(\"[buffer-controller]: \" + type + \" SourceBuffer error\", event);\n // according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error\n // SourceBuffer errors are not necessarily fatal; if so, the HTMLMediaElement will fire an error event\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_3__.ErrorDetails.BUFFER_APPENDING_ERROR,\n fatal: false\n });\n // updateend is always fired after error, so we'll allow that to shift the current operation off of the queue\n var operation = this.operationQueue.current(type);\n if (operation) {\n operation.onError(event);\n }\n }\n\n // This method must result in an updateend event; if remove is not called, _onSBUpdateEnd must be called manually\n ;\n _proto.removeExecutor = function removeExecutor(type, startOffset, endOffset) {\n var media = this.media,\n mediaSource = this.mediaSource,\n operationQueue = this.operationQueue,\n sourceBuffer = this.sourceBuffer;\n var sb = sourceBuffer[type];\n if (!media || !mediaSource || !sb) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.warn(\"[buffer-controller]: Attempting to remove from the \" + type + \" SourceBuffer, but it does not exist\");\n operationQueue.shiftAndExecuteNext(type);\n return;\n }\n var mediaDuration = (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(media.duration) ? media.duration : Infinity;\n var msDuration = (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(mediaSource.duration) ? mediaSource.duration : Infinity;\n var removeStart = Math.max(0, startOffset);\n var removeEnd = Math.min(endOffset, mediaDuration, msDuration);\n if (removeEnd > removeStart && !sb.ending) {\n sb.ended = false;\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log(\"[buffer-controller]: Removing [\" + removeStart + \",\" + removeEnd + \"] from the \" + type + \" SourceBuffer\");\n console.assert(!sb.updating, type + \" sourceBuffer must not be updating\");\n sb.remove(removeStart, removeEnd);\n } else {\n // Cycle the queue\n operationQueue.shiftAndExecuteNext(type);\n }\n }\n\n // This method must result in an updateend event; if append is not called, _onSBUpdateEnd must be called manually\n ;\n _proto.appendExecutor = function appendExecutor(data, type) {\n var operationQueue = this.operationQueue,\n sourceBuffer = this.sourceBuffer;\n var sb = sourceBuffer[type];\n if (!sb) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.warn(\"[buffer-controller]: Attempting to append to the \" + type + \" SourceBuffer, but it does not exist\");\n operationQueue.shiftAndExecuteNext(type);\n return;\n }\n sb.ended = false;\n console.assert(!sb.updating, type + \" sourceBuffer must not be updating\");\n sb.appendBuffer(data);\n }\n\n // Enqueues an operation to each SourceBuffer queue which, upon execution, resolves a promise. When all promises\n // resolve, the onUnblocked function is executed. Functions calling this method do not need to unblock the queue\n // upon completion, since we already do it here\n ;\n _proto.blockBuffers = function blockBuffers(onUnblocked, buffers) {\n var _this9 = this;\n if (buffers === void 0) {\n buffers = this.getSourceBufferTypes();\n }\n if (!buffers.length) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log('[buffer-controller]: Blocking operation requested, but no SourceBuffers exist');\n Promise.resolve().then(onUnblocked);\n return;\n }\n var operationQueue = this.operationQueue;\n\n // logger.debug(`[buffer-controller]: Blocking ${buffers} SourceBuffer`);\n var blockingOperations = buffers.map(function (type) {\n return operationQueue.appendBlocker(type);\n });\n Promise.all(blockingOperations).then(function () {\n // logger.debug(`[buffer-controller]: Blocking operation resolved; unblocking ${buffers} SourceBuffer`);\n onUnblocked();\n buffers.forEach(function (type) {\n var sb = _this9.sourceBuffer[type];\n // Only cycle the queue if the SB is not updating. There's a bug in Chrome which sets the SB updating flag to\n // true when changing the MediaSource duration (https://bugs.chromium.org/p/chromium/issues/detail?id=959359&can=2&q=mediasource%20duration)\n // While this is a workaround, it's probably useful to have around\n if (!sb || !sb.updating) {\n operationQueue.shiftAndExecuteNext(type);\n }\n });\n });\n };\n _proto.getSourceBufferTypes = function getSourceBufferTypes() {\n return Object.keys(this.sourceBuffer);\n };\n _proto.addBufferListener = function addBufferListener(type, event, fn) {\n var buffer = this.sourceBuffer[type];\n if (!buffer) {\n return;\n }\n var listener = fn.bind(this, type);\n this.listeners[type].push({\n event: event,\n listener: listener\n });\n buffer.addEventListener(event, listener);\n };\n _proto.removeBufferListeners = function removeBufferListeners(type) {\n var buffer = this.sourceBuffer[type];\n if (!buffer) {\n return;\n }\n this.listeners[type].forEach(function (l) {\n buffer.removeEventListener(l.event, l.listener);\n });\n };\n return BufferController;\n}();\n\n\n/***/ }),\n\n/***/ \"./src/controller/buffer-operation-queue.ts\":\n/*!**************************************************!*\\\n !*** ./src/controller/buffer-operation-queue.ts ***!\n \\**************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ BufferOperationQueue)\n/* harmony export */ });\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n\nvar BufferOperationQueue = /*#__PURE__*/function () {\n function BufferOperationQueue(sourceBufferReference) {\n this.buffers = void 0;\n this.queues = {\n video: [],\n audio: [],\n audiovideo: []\n };\n this.buffers = sourceBufferReference;\n }\n var _proto = BufferOperationQueue.prototype;\n _proto.append = function append(operation, type) {\n var queue = this.queues[type];\n queue.push(operation);\n if (queue.length === 1 && this.buffers[type]) {\n this.executeNext(type);\n }\n };\n _proto.insertAbort = function insertAbort(operation, type) {\n var queue = this.queues[type];\n queue.unshift(operation);\n this.executeNext(type);\n };\n _proto.appendBlocker = function appendBlocker(type) {\n var execute;\n var promise = new Promise(function (resolve) {\n execute = resolve;\n });\n var operation = {\n execute: execute,\n onStart: function onStart() {},\n onComplete: function onComplete() {},\n onError: function onError() {}\n };\n this.append(operation, type);\n return promise;\n };\n _proto.executeNext = function executeNext(type) {\n var buffers = this.buffers,\n queues = this.queues;\n var sb = buffers[type];\n var queue = queues[type];\n if (queue.length) {\n var operation = queue[0];\n try {\n // Operations are expected to result in an 'updateend' event being fired. If not, the queue will lock. Operations\n // which do not end with this event must call _onSBUpdateEnd manually\n operation.execute();\n } catch (e) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_0__.logger.warn('[buffer-operation-queue]: Unhandled exception executing the current operation');\n operation.onError(e);\n\n // Only shift the current operation off, otherwise the updateend handler will do this for us\n if (!sb || !sb.updating) {\n queue.shift();\n this.executeNext(type);\n }\n }\n }\n };\n _proto.shiftAndExecuteNext = function shiftAndExecuteNext(type) {\n this.queues[type].shift();\n this.executeNext(type);\n };\n _proto.current = function current(type) {\n return this.queues[type][0];\n };\n return BufferOperationQueue;\n}();\n\n\n/***/ }),\n\n/***/ \"./src/controller/cap-level-controller.ts\":\n/*!************************************************!*\\\n !*** ./src/controller/cap-level-controller.ts ***!\n \\************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/*\n * cap stream level to media size dimension controller\n */\n\n\nvar CapLevelController = /*#__PURE__*/function () {\n function CapLevelController(hls) {\n this.autoLevelCapping = void 0;\n this.firstLevel = void 0;\n this.media = void 0;\n this.restrictedLevels = void 0;\n this.timer = void 0;\n this.hls = void 0;\n this.streamController = void 0;\n this.clientRect = void 0;\n this.hls = hls;\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.firstLevel = -1;\n this.media = null;\n this.restrictedLevels = [];\n this.timer = undefined;\n this.clientRect = null;\n this.registerListeners();\n }\n var _proto = CapLevelController.prototype;\n _proto.setStreamController = function setStreamController(streamController) {\n this.streamController = streamController;\n };\n _proto.destroy = function destroy() {\n this.unregisterListener();\n if (this.hls.config.capLevelToPlayerSize) {\n this.stopCapping();\n }\n this.media = null;\n this.clientRect = null;\n // @ts-ignore\n this.hls = this.streamController = null;\n };\n _proto.registerListeners = function registerListeners() {\n var hls = this.hls;\n hls.on(_events__WEBPACK_IMPORTED_MODULE_0__.Events.FPS_DROP_LEVEL_CAPPING, this.onFpsDropLevelCapping, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_0__.Events.MEDIA_ATTACHING, this.onMediaAttaching, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_0__.Events.MANIFEST_PARSED, this.onManifestParsed, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_0__.Events.BUFFER_CODECS, this.onBufferCodecs, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_0__.Events.MEDIA_DETACHING, this.onMediaDetaching, this);\n };\n _proto.unregisterListener = function unregisterListener() {\n var hls = this.hls;\n hls.off(_events__WEBPACK_IMPORTED_MODULE_0__.Events.FPS_DROP_LEVEL_CAPPING, this.onFpsDropLevelCapping, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_0__.Events.MEDIA_ATTACHING, this.onMediaAttaching, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_0__.Events.MANIFEST_PARSED, this.onManifestParsed, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_0__.Events.BUFFER_CODECS, this.onBufferCodecs, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_0__.Events.MEDIA_DETACHING, this.onMediaDetaching, this);\n };\n _proto.onFpsDropLevelCapping = function onFpsDropLevelCapping(event, data) {\n // Don't add a restricted level more than once\n if (CapLevelController.isLevelAllowed(data.droppedLevel, this.restrictedLevels)) {\n this.restrictedLevels.push(data.droppedLevel);\n }\n };\n _proto.onMediaAttaching = function onMediaAttaching(event, data) {\n this.media = data.media instanceof HTMLVideoElement ? data.media : null;\n this.clientRect = null;\n };\n _proto.onManifestParsed = function onManifestParsed(event, data) {\n var hls = this.hls;\n this.restrictedLevels = [];\n this.firstLevel = data.firstLevel;\n if (hls.config.capLevelToPlayerSize && data.video) {\n // Start capping immediately if the manifest has signaled video codecs\n this.startCapping();\n }\n }\n\n // Only activate capping when playing a video stream; otherwise, multi-bitrate audio-only streams will be restricted\n // to the first level\n ;\n _proto.onBufferCodecs = function onBufferCodecs(event, data) {\n var hls = this.hls;\n if (hls.config.capLevelToPlayerSize && data.video) {\n // If the manifest did not signal a video codec capping has been deferred until we're certain video is present\n this.startCapping();\n }\n };\n _proto.onMediaDetaching = function onMediaDetaching() {\n this.stopCapping();\n };\n _proto.detectPlayerSize = function detectPlayerSize() {\n if (this.media && this.mediaHeight > 0 && this.mediaWidth > 0) {\n var levels = this.hls.levels;\n if (levels.length) {\n var hls = this.hls;\n hls.autoLevelCapping = this.getMaxLevel(levels.length - 1);\n if (hls.autoLevelCapping > this.autoLevelCapping && this.streamController) {\n // if auto level capping has a higher value for the previous one, flush the buffer using nextLevelSwitch\n // usually happen when the user go to the fullscreen mode.\n this.streamController.nextLevelSwitch();\n }\n this.autoLevelCapping = hls.autoLevelCapping;\n }\n }\n }\n\n /*\n * returns level should be the one with the dimensions equal or greater than the media (player) dimensions (so the video will be downscaled)\n */;\n _proto.getMaxLevel = function getMaxLevel(capLevelIndex) {\n var _this = this;\n var levels = this.hls.levels;\n if (!levels.length) {\n return -1;\n }\n var validLevels = levels.filter(function (level, index) {\n return CapLevelController.isLevelAllowed(index, _this.restrictedLevels) && index <= capLevelIndex;\n });\n this.clientRect = null;\n return CapLevelController.getMaxLevelByMediaSize(validLevels, this.mediaWidth, this.mediaHeight);\n };\n _proto.startCapping = function startCapping() {\n if (this.timer) {\n // Don't reset capping if started twice; this can happen if the manifest signals a video codec\n return;\n }\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.hls.firstLevel = this.getMaxLevel(this.firstLevel);\n self.clearInterval(this.timer);\n this.timer = self.setInterval(this.detectPlayerSize.bind(this), 1000);\n this.detectPlayerSize();\n };\n _proto.stopCapping = function stopCapping() {\n this.restrictedLevels = [];\n this.firstLevel = -1;\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n if (this.timer) {\n self.clearInterval(this.timer);\n this.timer = undefined;\n }\n };\n _proto.getDimensions = function getDimensions() {\n if (this.clientRect) {\n return this.clientRect;\n }\n var media = this.media;\n var boundsRect = {\n width: 0,\n height: 0\n };\n if (media) {\n var clientRect = media.getBoundingClientRect();\n boundsRect.width = clientRect.width;\n boundsRect.height = clientRect.height;\n if (!boundsRect.width && !boundsRect.height) {\n // When the media element has no width or height (equivalent to not being in the DOM),\n // then use its width and height attributes (media.width, media.height)\n boundsRect.width = clientRect.right - clientRect.left || media.width || 0;\n boundsRect.height = clientRect.bottom - clientRect.top || media.height || 0;\n }\n }\n this.clientRect = boundsRect;\n return boundsRect;\n };\n CapLevelController.isLevelAllowed = function isLevelAllowed(level, restrictedLevels) {\n if (restrictedLevels === void 0) {\n restrictedLevels = [];\n }\n return restrictedLevels.indexOf(level) === -1;\n };\n CapLevelController.getMaxLevelByMediaSize = function getMaxLevelByMediaSize(levels, width, height) {\n if (!levels || !levels.length) {\n return -1;\n }\n\n // Levels can have the same dimensions but differing bandwidths - since levels are ordered, we can look to the next\n // to determine whether we've chosen the greatest bandwidth for the media's dimensions\n var atGreatestBandwidth = function atGreatestBandwidth(curLevel, nextLevel) {\n if (!nextLevel) {\n return true;\n }\n return curLevel.width !== nextLevel.width || curLevel.height !== nextLevel.height;\n };\n\n // If we run through the loop without breaking, the media's dimensions are greater than every level, so default to\n // the max level\n var maxLevelIndex = levels.length - 1;\n for (var i = 0; i < levels.length; i += 1) {\n var level = levels[i];\n if ((level.width >= width || level.height >= height) && atGreatestBandwidth(level, levels[i + 1])) {\n maxLevelIndex = i;\n break;\n }\n }\n return maxLevelIndex;\n };\n _createClass(CapLevelController, [{\n key: \"mediaWidth\",\n get: function get() {\n return this.getDimensions().width * this.contentScaleFactor;\n }\n }, {\n key: \"mediaHeight\",\n get: function get() {\n return this.getDimensions().height * this.contentScaleFactor;\n }\n }, {\n key: \"contentScaleFactor\",\n get: function get() {\n var pixelRatio = 1;\n if (!this.hls.config.ignoreDevicePixelRatio) {\n try {\n pixelRatio = self.devicePixelRatio;\n } catch (e) {\n /* no-op */\n }\n }\n return pixelRatio;\n }\n }]);\n return CapLevelController;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CapLevelController);\n\n/***/ }),\n\n/***/ \"./src/controller/fps-controller.ts\":\n/*!******************************************!*\\\n !*** ./src/controller/fps-controller.ts ***!\n \\******************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n\n\nvar FPSController = /*#__PURE__*/function () {\n // stream controller must be provided as a dependency!\n\n function FPSController(hls) {\n this.hls = void 0;\n this.isVideoPlaybackQualityAvailable = false;\n this.timer = void 0;\n this.media = null;\n this.lastTime = void 0;\n this.lastDroppedFrames = 0;\n this.lastDecodedFrames = 0;\n this.streamController = void 0;\n this.hls = hls;\n this.registerListeners();\n }\n var _proto = FPSController.prototype;\n _proto.setStreamController = function setStreamController(streamController) {\n this.streamController = streamController;\n };\n _proto.registerListeners = function registerListeners() {\n this.hls.on(_events__WEBPACK_IMPORTED_MODULE_0__.Events.MEDIA_ATTACHING, this.onMediaAttaching, this);\n };\n _proto.unregisterListeners = function unregisterListeners() {\n this.hls.off(_events__WEBPACK_IMPORTED_MODULE_0__.Events.MEDIA_ATTACHING, this.onMediaAttaching);\n };\n _proto.destroy = function destroy() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.unregisterListeners();\n this.isVideoPlaybackQualityAvailable = false;\n this.media = null;\n };\n _proto.onMediaAttaching = function onMediaAttaching(event, data) {\n var config = this.hls.config;\n if (config.capLevelOnFPSDrop) {\n var media = data.media instanceof self.HTMLVideoElement ? data.media : null;\n this.media = media;\n if (media && typeof media.getVideoPlaybackQuality === 'function') {\n this.isVideoPlaybackQualityAvailable = true;\n }\n self.clearInterval(this.timer);\n this.timer = self.setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);\n }\n };\n _proto.checkFPS = function checkFPS(video, decodedFrames, droppedFrames) {\n var currentTime = performance.now();\n if (decodedFrames) {\n if (this.lastTime) {\n var currentPeriod = currentTime - this.lastTime;\n var currentDropped = droppedFrames - this.lastDroppedFrames;\n var currentDecoded = decodedFrames - this.lastDecodedFrames;\n var droppedFPS = 1000 * currentDropped / currentPeriod;\n var hls = this.hls;\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_0__.Events.FPS_DROP, {\n currentDropped: currentDropped,\n currentDecoded: currentDecoded,\n totalDroppedFrames: droppedFrames\n });\n if (droppedFPS > 0) {\n // logger.log('checkFPS : droppedFPS/decodedFPS:' + droppedFPS/(1000 * currentDecoded / currentPeriod));\n if (currentDropped > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n var currentLevel = hls.currentLevel;\n _utils_logger__WEBPACK_IMPORTED_MODULE_1__.logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {\n currentLevel = currentLevel - 1;\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_0__.Events.FPS_DROP_LEVEL_CAPPING, {\n level: currentLevel,\n droppedLevel: hls.currentLevel\n });\n hls.autoLevelCapping = currentLevel;\n this.streamController.nextLevelSwitch();\n }\n }\n }\n }\n this.lastTime = currentTime;\n this.lastDroppedFrames = droppedFrames;\n this.lastDecodedFrames = decodedFrames;\n }\n };\n _proto.checkFPSInterval = function checkFPSInterval() {\n var video = this.media;\n if (video) {\n if (this.isVideoPlaybackQualityAvailable) {\n var videoPlaybackQuality = video.getVideoPlaybackQuality();\n this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n } else {\n // HTMLVideoElement doesn't include the webkit types\n this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);\n }\n }\n };\n return FPSController;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FPSController);\n\n/***/ }),\n\n/***/ \"./src/controller/fragment-finders.ts\":\n/*!********************************************!*\\\n !*** ./src/controller/fragment-finders.ts ***!\n \\********************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"findFragWithCC\": () => (/* binding */ findFragWithCC),\n/* harmony export */ \"findFragmentByPDT\": () => (/* binding */ findFragmentByPDT),\n/* harmony export */ \"findFragmentByPTS\": () => (/* binding */ findFragmentByPTS),\n/* harmony export */ \"fragmentWithinToleranceTest\": () => (/* binding */ fragmentWithinToleranceTest),\n/* harmony export */ \"pdtWithinToleranceTest\": () => (/* binding */ pdtWithinToleranceTest)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _utils_binary_search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/binary-search */ \"./src/utils/binary-search.ts\");\n\n\n/**\n * Returns first fragment whose endPdt value exceeds the given PDT.\n * @param {Array<Fragment>} fragments - The array of candidate fragments\n * @param {number|null} [PDTValue = null] - The PDT value which must be exceeded\n * @param {number} [maxFragLookUpTolerance = 0] - The amount of time that a fragment's start/end can be within in order to be considered contiguous\n * @returns {*|null} fragment - The best matching fragment\n */\nfunction findFragmentByPDT(fragments, PDTValue, maxFragLookUpTolerance) {\n if (PDTValue === null || !Array.isArray(fragments) || !fragments.length || !(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(PDTValue)) {\n return null;\n }\n\n // if less than start\n var startPDT = fragments[0].programDateTime;\n if (PDTValue < (startPDT || 0)) {\n return null;\n }\n var endPDT = fragments[fragments.length - 1].endProgramDateTime;\n if (PDTValue >= (endPDT || 0)) {\n return null;\n }\n maxFragLookUpTolerance = maxFragLookUpTolerance || 0;\n for (var seg = 0; seg < fragments.length; ++seg) {\n var frag = fragments[seg];\n if (pdtWithinToleranceTest(PDTValue, maxFragLookUpTolerance, frag)) {\n return frag;\n }\n }\n return null;\n}\n\n/**\n * Finds a fragment based on the SN of the previous fragment; or based on the needs of the current buffer.\n * This method compensates for small buffer gaps by applying a tolerance to the start of any candidate fragment, thus\n * breaking any traps which would cause the same fragment to be continuously selected within a small range.\n * @param {*} fragPrevious - The last frag successfully appended\n * @param {Array} fragments - The array of candidate fragments\n * @param {number} [bufferEnd = 0] - The end of the contiguous buffered range the playhead is currently within\n * @param {number} maxFragLookUpTolerance - The amount of time that a fragment's start/end can be within in order to be considered contiguous\n * @returns {*} foundFrag - The best matching fragment\n */\nfunction findFragmentByPTS(fragPrevious, fragments, bufferEnd, maxFragLookUpTolerance) {\n if (bufferEnd === void 0) {\n bufferEnd = 0;\n }\n if (maxFragLookUpTolerance === void 0) {\n maxFragLookUpTolerance = 0;\n }\n var fragNext = null;\n if (fragPrevious) {\n fragNext = fragments[fragPrevious.sn - fragments[0].sn + 1] || null;\n } else if (bufferEnd === 0 && fragments[0].start === 0) {\n fragNext = fragments[0];\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && fragmentWithinToleranceTest(bufferEnd, maxFragLookUpTolerance, fragNext) === 0) {\n return fragNext;\n }\n // We might be seeking past the tolerance so find the best match\n var foundFragment = _utils_binary_search__WEBPACK_IMPORTED_MODULE_1__[\"default\"].search(fragments, fragmentWithinToleranceTest.bind(null, bufferEnd, maxFragLookUpTolerance));\n if (foundFragment && (foundFragment !== fragPrevious || !fragNext)) {\n return foundFragment;\n }\n // If no match was found return the next fragment after fragPrevious, or null\n return fragNext;\n}\n\n/**\n * The test function used by the findFragmentBySn's BinarySearch to look for the best match to the current buffer conditions.\n * @param {*} candidate - The fragment to test\n * @param {number} [bufferEnd = 0] - The end of the current buffered range the playhead is currently within\n * @param {number} [maxFragLookUpTolerance = 0] - The amount of time that a fragment's start can be within in order to be considered contiguous\n * @returns {number} - 0 if it matches, 1 if too low, -1 if too high\n */\nfunction fragmentWithinToleranceTest(bufferEnd, maxFragLookUpTolerance, candidate) {\n if (bufferEnd === void 0) {\n bufferEnd = 0;\n }\n if (maxFragLookUpTolerance === void 0) {\n maxFragLookUpTolerance = 0;\n }\n // eagerly accept an accurate match (no tolerance)\n if (candidate.start <= bufferEnd && candidate.start + candidate.duration > bufferEnd) {\n return 0;\n }\n // offset should be within fragment boundary - config.maxFragLookUpTolerance\n // this is to cope with situations like\n // bufferEnd = 9.991\n // frag[Ø] : [0,10]\n // frag[1] : [10,20]\n // bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here\n // frag start frag start+duration\n // |-----------------------------|\n // <---> <--->\n // ...--------><-----------------------------><---------....\n // previous frag matching fragment next frag\n // return -1 return 0 return 1\n // logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);\n // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n var candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration + (candidate.deltaPTS ? candidate.deltaPTS : 0));\n if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {\n return 1;\n } else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n return -1;\n }\n return 0;\n}\n\n/**\n * The test function used by the findFragmentByPdt's BinarySearch to look for the best match to the current buffer conditions.\n * This function tests the candidate's program date time values, as represented in Unix time\n * @param {*} candidate - The fragment to test\n * @param {number} [pdtBufferEnd = 0] - The Unix time representing the end of the current buffered range\n * @param {number} [maxFragLookUpTolerance = 0] - The amount of time that a fragment's start can be within in order to be considered contiguous\n * @returns {boolean} True if contiguous, false otherwise\n */\nfunction pdtWithinToleranceTest(pdtBufferEnd, maxFragLookUpTolerance, candidate) {\n var candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration + (candidate.deltaPTS ? candidate.deltaPTS : 0)) * 1000;\n\n // endProgramDateTime can be null, default to zero\n var endProgramDateTime = candidate.endProgramDateTime || 0;\n return endProgramDateTime - candidateLookupTolerance > pdtBufferEnd;\n}\nfunction findFragWithCC(fragments, cc) {\n return _utils_binary_search__WEBPACK_IMPORTED_MODULE_1__[\"default\"].search(fragments, function (candidate) {\n if (candidate.cc < cc) {\n return 1;\n } else if (candidate.cc > cc) {\n return -1;\n } else {\n return 0;\n }\n });\n}\n\n/***/ }),\n\n/***/ \"./src/controller/fragment-tracker.ts\":\n/*!********************************************!*\\\n !*** ./src/controller/fragment-tracker.ts ***!\n \\********************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"FragmentState\": () => (/* binding */ FragmentState),\n/* harmony export */ \"FragmentTracker\": () => (/* binding */ FragmentTracker)\n/* harmony export */ });\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _types_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types/loader */ \"./src/types/loader.ts\");\n\n\nvar FragmentState;\n(function (FragmentState) {\n FragmentState[\"NOT_LOADED\"] = \"NOT_LOADED\";\n FragmentState[\"APPENDING\"] = \"APPENDING\";\n FragmentState[\"PARTIAL\"] = \"PARTIAL\";\n FragmentState[\"OK\"] = \"OK\";\n})(FragmentState || (FragmentState = {}));\nvar FragmentTracker = /*#__PURE__*/function () {\n function FragmentTracker(hls) {\n this.activeFragment = null;\n this.activeParts = null;\n this.endListFragments = Object.create(null);\n this.fragments = Object.create(null);\n this.timeRanges = Object.create(null);\n this.bufferPadding = 0.2;\n this.hls = void 0;\n this.hls = hls;\n this._registerListeners();\n }\n var _proto = FragmentTracker.prototype;\n _proto._registerListeners = function _registerListeners() {\n var hls = this.hls;\n hls.on(_events__WEBPACK_IMPORTED_MODULE_0__.Events.BUFFER_APPENDED, this.onBufferAppended, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_0__.Events.FRAG_BUFFERED, this.onFragBuffered, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_0__.Events.FRAG_LOADED, this.onFragLoaded, this);\n };\n _proto._unregisterListeners = function _unregisterListeners() {\n var hls = this.hls;\n hls.off(_events__WEBPACK_IMPORTED_MODULE_0__.Events.BUFFER_APPENDED, this.onBufferAppended, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_0__.Events.FRAG_BUFFERED, this.onFragBuffered, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_0__.Events.FRAG_LOADED, this.onFragLoaded, this);\n };\n _proto.destroy = function destroy() {\n this._unregisterListeners();\n // @ts-ignore\n this.fragments =\n // @ts-ignore\n this.endListFragments = this.timeRanges = this.activeFragment = this.activeParts = null;\n }\n\n /**\n * Return a Fragment with an appended range that matches the position and levelType.\n * If not found any Fragment, return null\n */;\n _proto.getAppendedFrag = function getAppendedFrag(position, levelType) {\n if (levelType === _types_loader__WEBPACK_IMPORTED_MODULE_1__.PlaylistLevelType.MAIN) {\n var activeFragment = this.activeFragment,\n activeParts = this.activeParts;\n if (!activeFragment) {\n return null;\n }\n if (activeParts) {\n for (var i = activeParts.length; i--;) {\n var activePart = activeParts[i];\n var appendedPTS = activePart ? activePart.end : activeFragment.appendedPTS;\n if (activePart.start <= position && appendedPTS !== undefined && position <= appendedPTS) {\n // 9 is a magic number. remove parts from lookup after a match but keep some short seeks back.\n if (i > 9) {\n this.activeParts = activeParts.slice(i - 9);\n }\n return activePart;\n }\n }\n } else if (activeFragment.start <= position && activeFragment.appendedPTS !== undefined && position <= activeFragment.appendedPTS) {\n return activeFragment;\n }\n }\n return this.getBufferedFrag(position, levelType);\n }\n\n /**\n * Return a buffered Fragment that matches the position and levelType.\n * A buffered Fragment is one whose loading, parsing and appending is done (completed or \"partial\" meaning aborted).\n * If not found any Fragment, return null\n */;\n _proto.getBufferedFrag = function getBufferedFrag(position, levelType) {\n var fragments = this.fragments;\n var keys = Object.keys(fragments);\n for (var i = keys.length; i--;) {\n var fragmentEntity = fragments[keys[i]];\n if ((fragmentEntity === null || fragmentEntity === void 0 ? void 0 : fragmentEntity.body.type) === levelType && fragmentEntity.buffered) {\n var frag = fragmentEntity.body;\n if (frag.start <= position && position <= frag.end) {\n return frag;\n }\n }\n }\n return null;\n }\n\n /**\n * Partial fragments effected by coded frame eviction will be removed\n * The browser will unload parts of the buffer to free up memory for new buffer data\n * Fragments will need to be reloaded when the buffer is freed up, removing partial fragments will allow them to reload(since there might be parts that are still playable)\n */;\n _proto.detectEvictedFragments = function detectEvictedFragments(elementaryStream, timeRange, playlistType) {\n var _this = this;\n if (this.timeRanges) {\n this.timeRanges[elementaryStream] = timeRange;\n }\n // Check if any flagged fragments have been unloaded\n Object.keys(this.fragments).forEach(function (key) {\n var fragmentEntity = _this.fragments[key];\n if (!fragmentEntity) {\n return;\n }\n if (!fragmentEntity.buffered && !fragmentEntity.loaded) {\n if (fragmentEntity.body.type === playlistType) {\n _this.removeFragment(fragmentEntity.body);\n }\n return;\n }\n var esData = fragmentEntity.range[elementaryStream];\n if (!esData) {\n return;\n }\n esData.time.some(function (time) {\n var isNotBuffered = !_this.isTimeBuffered(time.startPTS, time.endPTS, timeRange);\n if (isNotBuffered) {\n // Unregister partial fragment as it needs to load again to be reused\n _this.removeFragment(fragmentEntity.body);\n }\n return isNotBuffered;\n });\n });\n }\n\n /**\n * Checks if the fragment passed in is loaded in the buffer properly\n * Partially loaded fragments will be registered as a partial fragment\n */;\n _proto.detectPartialFragments = function detectPartialFragments(data) {\n var _this2 = this;\n var timeRanges = this.timeRanges;\n var frag = data.frag,\n part = data.part;\n if (!timeRanges || frag.sn === 'initSegment') {\n return;\n }\n var fragKey = getFragmentKey(frag);\n var fragmentEntity = this.fragments[fragKey];\n if (!fragmentEntity) {\n return;\n }\n Object.keys(timeRanges).forEach(function (elementaryStream) {\n var streamInfo = frag.elementaryStreams[elementaryStream];\n if (!streamInfo) {\n return;\n }\n var timeRange = timeRanges[elementaryStream];\n var partial = part !== null || streamInfo.partial === true;\n fragmentEntity.range[elementaryStream] = _this2.getBufferedTimes(frag, part, partial, timeRange);\n });\n fragmentEntity.loaded = null;\n if (Object.keys(fragmentEntity.range).length) {\n fragmentEntity.buffered = true;\n if (fragmentEntity.body.endList) {\n this.endListFragments[fragmentEntity.body.type] = fragmentEntity;\n }\n } else {\n // remove fragment if nothing was appended\n this.removeFragment(fragmentEntity.body);\n }\n };\n _proto.fragBuffered = function fragBuffered(frag) {\n var fragKey = getFragmentKey(frag);\n var fragmentEntity = this.fragments[fragKey];\n if (fragmentEntity) {\n fragmentEntity.loaded = null;\n fragmentEntity.buffered = true;\n }\n };\n _proto.getBufferedTimes = function getBufferedTimes(fragment, part, partial, timeRange) {\n var buffered = {\n time: [],\n partial: partial\n };\n var startPTS = part ? part.start : fragment.start;\n var endPTS = part ? part.end : fragment.end;\n var minEndPTS = fragment.minEndPTS || endPTS;\n var maxStartPTS = fragment.maxStartPTS || startPTS;\n for (var i = 0; i < timeRange.length; i++) {\n var startTime = timeRange.start(i) - this.bufferPadding;\n var endTime = timeRange.end(i) + this.bufferPadding;\n if (maxStartPTS >= startTime && minEndPTS <= endTime) {\n // Fragment is entirely contained in buffer\n // No need to check the other timeRange times since it's completely playable\n buffered.time.push({\n startPTS: Math.max(startPTS, timeRange.start(i)),\n endPTS: Math.min(endPTS, timeRange.end(i))\n });\n break;\n } else if (startPTS < endTime && endPTS > startTime) {\n buffered.partial = true;\n // Check for intersection with buffer\n // Get playable sections of the fragment\n buffered.time.push({\n startPTS: Math.max(startPTS, timeRange.start(i)),\n endPTS: Math.min(endPTS, timeRange.end(i))\n });\n } else if (endPTS <= startTime) {\n // No need to check the rest of the timeRange as it is in order\n break;\n }\n }\n return buffered;\n }\n\n /**\n * Gets the partial fragment for a certain time\n */;\n _proto.getPartialFragment = function getPartialFragment(time) {\n var bestFragment = null;\n var timePadding;\n var startTime;\n var endTime;\n var bestOverlap = 0;\n var bufferPadding = this.bufferPadding,\n fragments = this.fragments;\n Object.keys(fragments).forEach(function (key) {\n var fragmentEntity = fragments[key];\n if (!fragmentEntity) {\n return;\n }\n if (isPartial(fragmentEntity)) {\n startTime = fragmentEntity.body.start - bufferPadding;\n endTime = fragmentEntity.body.end + bufferPadding;\n if (time >= startTime && time <= endTime) {\n // Use the fragment that has the most padding from start and end time\n timePadding = Math.min(time - startTime, endTime - time);\n if (bestOverlap <= timePadding) {\n bestFragment = fragmentEntity.body;\n bestOverlap = timePadding;\n }\n }\n }\n });\n return bestFragment;\n };\n _proto.isEndListAppended = function isEndListAppended(type) {\n var lastFragmentEntity = this.endListFragments[type];\n return lastFragmentEntity !== undefined && (lastFragmentEntity.buffered || isPartial(lastFragmentEntity));\n };\n _proto.getState = function getState(fragment) {\n var fragKey = getFragmentKey(fragment);\n var fragmentEntity = this.fragments[fragKey];\n if (fragmentEntity) {\n if (!fragmentEntity.buffered) {\n return FragmentState.APPENDING;\n } else if (isPartial(fragmentEntity)) {\n return FragmentState.PARTIAL;\n } else {\n return FragmentState.OK;\n }\n }\n return FragmentState.NOT_LOADED;\n };\n _proto.isTimeBuffered = function isTimeBuffered(startPTS, endPTS, timeRange) {\n var startTime;\n var endTime;\n for (var i = 0; i < timeRange.length; i++) {\n startTime = timeRange.start(i) - this.bufferPadding;\n endTime = timeRange.end(i) + this.bufferPadding;\n if (startPTS >= startTime && endPTS <= endTime) {\n return true;\n }\n if (endPTS <= startTime) {\n // No need to check the rest of the timeRange as it is in order\n return false;\n }\n }\n return false;\n };\n _proto.onFragLoaded = function onFragLoaded(event, data) {\n var frag = data.frag,\n part = data.part;\n // don't track initsegment (for which sn is not a number)\n // don't track frags used for bitrateTest, they're irrelevant.\n // don't track parts for memory efficiency\n if (frag.sn === 'initSegment' || frag.bitrateTest || part) {\n return;\n }\n var fragKey = getFragmentKey(frag);\n this.fragments[fragKey] = {\n body: frag,\n loaded: data,\n buffered: false,\n range: Object.create(null)\n };\n };\n _proto.onBufferAppended = function onBufferAppended(event, data) {\n var _this3 = this;\n var frag = data.frag,\n part = data.part,\n timeRanges = data.timeRanges;\n if (frag.type === _types_loader__WEBPACK_IMPORTED_MODULE_1__.PlaylistLevelType.MAIN) {\n if (this.activeFragment !== frag) {\n this.activeFragment = frag;\n frag.appendedPTS = undefined;\n }\n if (part) {\n var activeParts = this.activeParts;\n if (!activeParts) {\n this.activeParts = activeParts = [];\n }\n activeParts.push(part);\n } else {\n this.activeParts = null;\n }\n }\n // Store the latest timeRanges loaded in the buffer\n this.timeRanges = timeRanges;\n Object.keys(timeRanges).forEach(function (elementaryStream) {\n var timeRange = timeRanges[elementaryStream];\n _this3.detectEvictedFragments(elementaryStream, timeRange);\n if (!part && frag.type === _types_loader__WEBPACK_IMPORTED_MODULE_1__.PlaylistLevelType.MAIN) {\n var streamInfo = frag.elementaryStreams[elementaryStream];\n if (!streamInfo) {\n return;\n }\n for (var i = 0; i < timeRange.length; i++) {\n var rangeEnd = timeRange.end(i);\n if (rangeEnd <= streamInfo.endPTS && rangeEnd > streamInfo.startPTS) {\n frag.appendedPTS = Math.max(rangeEnd, frag.appendedPTS || 0);\n } else {\n frag.appendedPTS = streamInfo.endPTS;\n }\n }\n }\n });\n };\n _proto.onFragBuffered = function onFragBuffered(event, data) {\n this.detectPartialFragments(data);\n };\n _proto.hasFragment = function hasFragment(fragment) {\n var fragKey = getFragmentKey(fragment);\n return !!this.fragments[fragKey];\n };\n _proto.removeFragmentsInRange = function removeFragmentsInRange(start, end, playlistType) {\n var _this4 = this;\n Object.keys(this.fragments).forEach(function (key) {\n var fragmentEntity = _this4.fragments[key];\n if (!fragmentEntity) {\n return;\n }\n if (fragmentEntity.buffered) {\n var frag = fragmentEntity.body;\n if (frag.type === playlistType && frag.start < end && frag.end > start) {\n _this4.removeFragment(frag);\n }\n }\n });\n };\n _proto.removeFragment = function removeFragment(fragment) {\n var fragKey = getFragmentKey(fragment);\n fragment.stats.loaded = 0;\n fragment.clearElementaryStreamInfo();\n fragment.appendedPTS = undefined;\n delete this.fragments[fragKey];\n if (fragment.endList) {\n delete this.endListFragments[fragment.type];\n }\n };\n _proto.removeAllFragments = function removeAllFragments() {\n this.fragments = Object.create(null);\n this.endListFragments = Object.create(null);\n this.activeFragment = null;\n this.activeParts = null;\n };\n return FragmentTracker;\n}();\nfunction isPartial(fragmentEntity) {\n var _fragmentEntity$range, _fragmentEntity$range2;\n return fragmentEntity.buffered && (((_fragmentEntity$range = fragmentEntity.range.video) === null || _fragmentEntity$range === void 0 ? void 0 : _fragmentEntity$range.partial) || ((_fragmentEntity$range2 = fragmentEntity.range.audio) === null || _fragmentEntity$range2 === void 0 ? void 0 : _fragmentEntity$range2.partial));\n}\nfunction getFragmentKey(fragment) {\n return fragment.type + \"_\" + fragment.level + \"_\" + fragment.urlId + \"_\" + fragment.sn;\n}\n\n/***/ }),\n\n/***/ \"./src/controller/gap-controller.ts\":\n/*!******************************************!*\\\n !*** ./src/controller/gap-controller.ts ***!\n \\******************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MAX_START_GAP_JUMP\": () => (/* binding */ MAX_START_GAP_JUMP),\n/* harmony export */ \"SKIP_BUFFER_HOLE_STEP_SECONDS\": () => (/* binding */ SKIP_BUFFER_HOLE_STEP_SECONDS),\n/* harmony export */ \"SKIP_BUFFER_RANGE_START\": () => (/* binding */ SKIP_BUFFER_RANGE_START),\n/* harmony export */ \"STALL_MINIMUM_DURATION_MS\": () => (/* binding */ STALL_MINIMUM_DURATION_MS),\n/* harmony export */ \"default\": () => (/* binding */ GapController)\n/* harmony export */ });\n/* harmony import */ var _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/buffer-helper */ \"./src/utils/buffer-helper.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n\n\n\n\nvar STALL_MINIMUM_DURATION_MS = 250;\nvar MAX_START_GAP_JUMP = 2.0;\nvar SKIP_BUFFER_HOLE_STEP_SECONDS = 0.1;\nvar SKIP_BUFFER_RANGE_START = 0.05;\nvar GapController = /*#__PURE__*/function () {\n function GapController(config, media, fragmentTracker, hls) {\n this.config = void 0;\n this.media = null;\n this.fragmentTracker = void 0;\n this.hls = void 0;\n this.nudgeRetry = 0;\n this.stallReported = false;\n this.stalled = null;\n this.moved = false;\n this.seeking = false;\n this.config = config;\n this.media = media;\n this.fragmentTracker = fragmentTracker;\n this.hls = hls;\n }\n var _proto = GapController.prototype;\n _proto.destroy = function destroy() {\n this.media = null;\n // @ts-ignore\n this.hls = this.fragmentTracker = null;\n }\n\n /**\n * Checks if the playhead is stuck within a gap, and if so, attempts to free it.\n * A gap is an unbuffered range between two buffered ranges (or the start and the first buffered range).\n *\n * @param {number} lastCurrentTime Previously read playhead position\n */;\n _proto.poll = function poll(lastCurrentTime, activeFrag) {\n var config = this.config,\n media = this.media,\n stalled = this.stalled;\n if (media === null) {\n return;\n }\n var currentTime = media.currentTime,\n seeking = media.seeking;\n var seeked = this.seeking && !seeking;\n var beginSeek = !this.seeking && seeking;\n this.seeking = seeking;\n\n // The playhead is moving, no-op\n if (currentTime !== lastCurrentTime) {\n this.moved = true;\n if (stalled !== null) {\n // The playhead is now moving, but was previously stalled\n if (this.stallReported) {\n var _stalledDuration = self.performance.now() - stalled;\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.warn(\"playback not stuck anymore @\" + currentTime + \", after \" + Math.round(_stalledDuration) + \"ms\");\n this.stallReported = false;\n }\n this.stalled = null;\n this.nudgeRetry = 0;\n }\n return;\n }\n\n // Clear stalled state when beginning or finishing seeking so that we don't report stalls coming out of a seek\n if (beginSeek || seeked) {\n this.stalled = null;\n }\n\n // The playhead should not be moving\n if (media.paused && !seeking || media.ended || media.playbackRate === 0 || !_utils_buffer_helper__WEBPACK_IMPORTED_MODULE_0__.BufferHelper.getBuffered(media).length) {\n return;\n }\n var bufferInfo = _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_0__.BufferHelper.bufferInfo(media, currentTime, 0);\n var isBuffered = bufferInfo.len > 0;\n var nextStart = bufferInfo.nextStart || 0;\n\n // There is no playable buffer (seeked, waiting for buffer)\n if (!isBuffered && !nextStart) {\n return;\n }\n if (seeking) {\n // Waiting for seeking in a buffered range to complete\n var hasEnoughBuffer = bufferInfo.len > MAX_START_GAP_JUMP;\n // Next buffered range is too far ahead to jump to while still seeking\n var noBufferGap = !nextStart || activeFrag && activeFrag.start <= currentTime || nextStart - currentTime > MAX_START_GAP_JUMP && !this.fragmentTracker.getPartialFragment(currentTime);\n if (hasEnoughBuffer || noBufferGap) {\n return;\n }\n // Reset moved state when seeking to a point in or before a gap\n this.moved = false;\n }\n\n // Skip start gaps if we haven't played, but the last poll detected the start of a stall\n // The addition poll gives the browser a chance to jump the gap for us\n if (!this.moved && this.stalled !== null) {\n var _level$details;\n // Jump start gaps within jump threshold\n var startJump = Math.max(nextStart, bufferInfo.start || 0) - currentTime;\n\n // When joining a live stream with audio tracks, account for live playlist window sliding by allowing\n // a larger jump over start gaps caused by the audio-stream-controller buffering a start fragment\n // that begins over 1 target duration after the video start position.\n var level = this.hls.levels ? this.hls.levels[this.hls.currentLevel] : null;\n var isLive = level === null || level === void 0 ? void 0 : (_level$details = level.details) === null || _level$details === void 0 ? void 0 : _level$details.live;\n var maxStartGapJump = isLive ? level.details.targetduration * 2 : MAX_START_GAP_JUMP;\n if (startJump > 0 && startJump <= maxStartGapJump) {\n this._trySkipBufferHole(null);\n return;\n }\n }\n\n // Start tracking stall time\n var tnow = self.performance.now();\n if (stalled === null) {\n this.stalled = tnow;\n return;\n }\n var stalledDuration = tnow - stalled;\n if (!seeking && stalledDuration >= STALL_MINIMUM_DURATION_MS) {\n // Report stalling after trying to fix\n this._reportStall(bufferInfo);\n if (!this.media) {\n return;\n }\n }\n var bufferedWithHoles = _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_0__.BufferHelper.bufferInfo(media, currentTime, config.maxBufferHole);\n this._tryFixBufferStall(bufferedWithHoles, stalledDuration);\n }\n\n /**\n * Detects and attempts to fix known buffer stalling issues.\n * @param bufferInfo - The properties of the current buffer.\n * @param stalledDurationMs - The amount of time Hls.js has been stalling for.\n * @private\n */;\n _proto._tryFixBufferStall = function _tryFixBufferStall(bufferInfo, stalledDurationMs) {\n var config = this.config,\n fragmentTracker = this.fragmentTracker,\n media = this.media;\n if (media === null) {\n return;\n }\n var currentTime = media.currentTime;\n var partial = fragmentTracker.getPartialFragment(currentTime);\n if (partial) {\n // Try to skip over the buffer hole caused by a partial fragment\n // This method isn't limited by the size of the gap between buffered ranges\n var targetTime = this._trySkipBufferHole(partial);\n // we return here in this case, meaning\n // the branch below only executes when we don't handle a partial fragment\n if (targetTime || !this.media) {\n return;\n }\n }\n\n // if we haven't had to skip over a buffer hole of a partial fragment\n // we may just have to \"nudge\" the playlist as the browser decoding/rendering engine\n // needs to cross some sort of threshold covering all source-buffers content\n // to start playing properly.\n if (bufferInfo.len > config.maxBufferHole && stalledDurationMs > config.highBufferWatchdogPeriod * 1000) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.warn('Trying to nudge playhead over buffer-hole');\n // Try to nudge currentTime over a buffer hole if we've been stalling for the configured amount of seconds\n // We only try to jump the hole if it's under the configured size\n // Reset stalled so to rearm watchdog timer\n this.stalled = null;\n this._tryNudgeBuffer();\n }\n }\n\n /**\n * Triggers a BUFFER_STALLED_ERROR event, but only once per stall period.\n * @param bufferLen - The playhead distance from the end of the current buffer segment.\n * @private\n */;\n _proto._reportStall = function _reportStall(bufferInfo) {\n var hls = this.hls,\n media = this.media,\n stallReported = this.stallReported;\n if (!stallReported && media) {\n // Report stalled error once\n this.stallReported = true;\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.warn(\"Playback stalling at @\" + media.currentTime + \" due to low buffer (\" + JSON.stringify(bufferInfo) + \")\");\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_2__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.BUFFER_STALLED_ERROR,\n fatal: false,\n buffer: bufferInfo.len\n });\n }\n }\n\n /**\n * Attempts to fix buffer stalls by jumping over known gaps caused by partial fragments\n * @param partial - The partial fragment found at the current time (where playback is stalling).\n * @private\n */;\n _proto._trySkipBufferHole = function _trySkipBufferHole(partial) {\n var config = this.config,\n hls = this.hls,\n media = this.media;\n if (media === null) {\n return 0;\n }\n var currentTime = media.currentTime;\n var lastEndTime = 0;\n // Check if currentTime is between unbuffered regions of partial fragments\n var buffered = _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_0__.BufferHelper.getBuffered(media);\n for (var i = 0; i < buffered.length; i++) {\n var startTime = buffered.start(i);\n if (currentTime + config.maxBufferHole >= lastEndTime && currentTime < startTime) {\n var targetTime = Math.max(startTime + SKIP_BUFFER_RANGE_START, media.currentTime + SKIP_BUFFER_HOLE_STEP_SECONDS);\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.warn(\"skipping hole, adjusting currentTime from \" + currentTime + \" to \" + targetTime);\n this.moved = true;\n this.stalled = null;\n media.currentTime = targetTime;\n if (partial) {\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_2__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.BUFFER_SEEK_OVER_HOLE,\n fatal: false,\n reason: \"fragment loaded with buffer holes, seeking from \" + currentTime + \" to \" + targetTime,\n frag: partial\n });\n }\n return targetTime;\n }\n lastEndTime = buffered.end(i);\n }\n return 0;\n }\n\n /**\n * Attempts to fix buffer stalls by advancing the mediaElement's current time by a small amount.\n * @private\n */;\n _proto._tryNudgeBuffer = function _tryNudgeBuffer() {\n var config = this.config,\n hls = this.hls,\n media = this.media,\n nudgeRetry = this.nudgeRetry;\n if (media === null) {\n return;\n }\n var currentTime = media.currentTime;\n this.nudgeRetry++;\n if (nudgeRetry < config.nudgeMaxRetry) {\n var targetTime = currentTime + (nudgeRetry + 1) * config.nudgeOffset;\n // playback stalled in buffered area ... let's nudge currentTime to try to overcome this\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.warn(\"Nudging 'currentTime' from \" + currentTime + \" to \" + targetTime);\n media.currentTime = targetTime;\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_2__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.BUFFER_NUDGE_ON_STALL,\n fatal: false\n });\n } else {\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.error(\"Playhead still not moving while enough data buffered @\" + currentTime + \" after \" + config.nudgeMaxRetry + \" nudges\");\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_2__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.BUFFER_STALLED_ERROR,\n fatal: true\n });\n }\n };\n return GapController;\n}();\n\n\n/***/ }),\n\n/***/ \"./src/controller/id3-track-controller.ts\":\n/*!************************************************!*\\\n !*** ./src/controller/id3-track-controller.ts ***!\n \\************************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _utils_texttrack_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/texttrack-utils */ \"./src/utils/texttrack-utils.ts\");\n/* harmony import */ var _demux_id3__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../demux/id3 */ \"./src/demux/id3.ts\");\n/* harmony import */ var _loader_date_range__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../loader/date-range */ \"./src/loader/date-range.ts\");\n/* harmony import */ var _types_demuxer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../types/demuxer */ \"./src/types/demuxer.ts\");\n\n\n\n\n\n\nvar MIN_CUE_DURATION = 0.25;\nfunction getCueClass() {\n // Attempt to recreate Safari functionality by creating\n // WebKitDataCue objects when available and store the decoded\n // ID3 data in the value property of the cue\n return self.WebKitDataCue || self.VTTCue || self.TextTrackCue;\n}\n\n// VTTCue latest draft allows an infinite duration, fallback\n// to MAX_VALUE if necessary\nvar MAX_CUE_ENDTIME = function () {\n var Cue = getCueClass();\n try {\n new Cue(0, Number.POSITIVE_INFINITY, '');\n } catch (e) {\n return Number.MAX_VALUE;\n }\n return Number.POSITIVE_INFINITY;\n}();\nfunction dateRangeDateToTimelineSeconds(date, offset) {\n return date.getTime() / 1000 - offset;\n}\nfunction hexToArrayBuffer(str) {\n return Uint8Array.from(str.replace(/^0x/, '').replace(/([\\da-fA-F]{2}) ?/g, '0x$1 ').replace(/ +$/, '').split(' ')).buffer;\n}\nvar ID3TrackController = /*#__PURE__*/function () {\n function ID3TrackController(hls) {\n this.hls = void 0;\n this.id3Track = null;\n this.media = null;\n this.dateRangeCuesAppended = {};\n this.hls = hls;\n this._registerListeners();\n }\n var _proto = ID3TrackController.prototype;\n _proto.destroy = function destroy() {\n this._unregisterListeners();\n this.id3Track = null;\n this.media = null;\n this.dateRangeCuesAppended = {};\n // @ts-ignore\n this.hls = null;\n };\n _proto._registerListeners = function _registerListeners() {\n var hls = this.hls;\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_ATTACHED, this.onMediaAttached, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_DETACHING, this.onMediaDetaching, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_LOADING, this.onManifestLoading, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.FRAG_PARSING_METADATA, this.onFragParsingMetadata, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_FLUSHING, this.onBufferFlushing, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_UPDATED, this.onLevelUpdated, this);\n };\n _proto._unregisterListeners = function _unregisterListeners() {\n var hls = this.hls;\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_ATTACHED, this.onMediaAttached, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_DETACHING, this.onMediaDetaching, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_LOADING, this.onManifestLoading, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.FRAG_PARSING_METADATA, this.onFragParsingMetadata, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.BUFFER_FLUSHING, this.onBufferFlushing, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_UPDATED, this.onLevelUpdated, this);\n }\n\n // Add ID3 metatadata text track.\n ;\n _proto.onMediaAttached = function onMediaAttached(event, data) {\n this.media = data.media;\n };\n _proto.onMediaDetaching = function onMediaDetaching() {\n if (!this.id3Track) {\n return;\n }\n (0,_utils_texttrack_utils__WEBPACK_IMPORTED_MODULE_2__.clearCurrentCues)(this.id3Track);\n this.id3Track = null;\n this.media = null;\n this.dateRangeCuesAppended = {};\n };\n _proto.onManifestLoading = function onManifestLoading() {\n this.dateRangeCuesAppended = {};\n };\n _proto.createTrack = function createTrack(media) {\n var track = this.getID3Track(media.textTracks);\n track.mode = 'hidden';\n return track;\n };\n _proto.getID3Track = function getID3Track(textTracks) {\n if (!this.media) {\n return;\n }\n for (var i = 0; i < textTracks.length; i++) {\n var textTrack = textTracks[i];\n if (textTrack.kind === 'metadata' && textTrack.label === 'id3') {\n // send 'addtrack' when reusing the textTrack for metadata,\n // same as what we do for captions\n (0,_utils_texttrack_utils__WEBPACK_IMPORTED_MODULE_2__.sendAddTrackEvent)(textTrack, this.media);\n return textTrack;\n }\n }\n return this.media.addTextTrack('metadata', 'id3');\n };\n _proto.onFragParsingMetadata = function onFragParsingMetadata(event, data) {\n if (!this.media) {\n return;\n }\n var _this$hls$config = this.hls.config,\n enableEmsgMetadataCues = _this$hls$config.enableEmsgMetadataCues,\n enableID3MetadataCues = _this$hls$config.enableID3MetadataCues;\n if (!enableEmsgMetadataCues && !enableID3MetadataCues) {\n return;\n }\n var samples = data.samples;\n\n // create track dynamically\n if (!this.id3Track) {\n this.id3Track = this.createTrack(this.media);\n }\n var Cue = getCueClass();\n for (var i = 0; i < samples.length; i++) {\n var type = samples[i].type;\n if (type === _types_demuxer__WEBPACK_IMPORTED_MODULE_5__.MetadataSchema.emsg && !enableEmsgMetadataCues || !enableID3MetadataCues) {\n continue;\n }\n var frames = _demux_id3__WEBPACK_IMPORTED_MODULE_3__.getID3Frames(samples[i].data);\n if (frames) {\n var startTime = samples[i].pts;\n var endTime = startTime + samples[i].duration;\n if (endTime > MAX_CUE_ENDTIME) {\n endTime = MAX_CUE_ENDTIME;\n }\n var timeDiff = endTime - startTime;\n if (timeDiff <= 0) {\n endTime = startTime + MIN_CUE_DURATION;\n }\n for (var j = 0; j < frames.length; j++) {\n var frame = frames[j];\n // Safari doesn't put the timestamp frame in the TextTrack\n if (!_demux_id3__WEBPACK_IMPORTED_MODULE_3__.isTimeStampFrame(frame)) {\n // add a bounds to any unbounded cues\n this.updateId3CueEnds(startTime);\n var cue = new Cue(startTime, endTime, '');\n cue.value = frame;\n if (type) {\n cue.type = type;\n }\n this.id3Track.addCue(cue);\n }\n }\n }\n }\n };\n _proto.updateId3CueEnds = function updateId3CueEnds(startTime) {\n var _this$id3Track;\n var cues = (_this$id3Track = this.id3Track) === null || _this$id3Track === void 0 ? void 0 : _this$id3Track.cues;\n if (cues) {\n for (var i = cues.length; i--;) {\n var cue = cues[i];\n if (cue.startTime < startTime && cue.endTime === MAX_CUE_ENDTIME) {\n cue.endTime = startTime;\n }\n }\n }\n };\n _proto.onBufferFlushing = function onBufferFlushing(event, _ref) {\n var startOffset = _ref.startOffset,\n endOffset = _ref.endOffset,\n type = _ref.type;\n var id3Track = this.id3Track,\n hls = this.hls;\n if (!hls) {\n return;\n }\n var _hls$config = hls.config,\n enableEmsgMetadataCues = _hls$config.enableEmsgMetadataCues,\n enableID3MetadataCues = _hls$config.enableID3MetadataCues;\n if (id3Track && (enableEmsgMetadataCues || enableID3MetadataCues)) {\n var predicate;\n if (type === 'audio') {\n predicate = function predicate(cue) {\n return cue.type === _types_demuxer__WEBPACK_IMPORTED_MODULE_5__.MetadataSchema.audioId3 && enableID3MetadataCues;\n };\n } else if (type === 'video') {\n predicate = function predicate(cue) {\n return cue.type === _types_demuxer__WEBPACK_IMPORTED_MODULE_5__.MetadataSchema.emsg && enableEmsgMetadataCues;\n };\n } else {\n predicate = function predicate(cue) {\n return cue.type === _types_demuxer__WEBPACK_IMPORTED_MODULE_5__.MetadataSchema.audioId3 && enableID3MetadataCues || cue.type === _types_demuxer__WEBPACK_IMPORTED_MODULE_5__.MetadataSchema.emsg && enableEmsgMetadataCues;\n };\n }\n (0,_utils_texttrack_utils__WEBPACK_IMPORTED_MODULE_2__.removeCuesInRange)(id3Track, startOffset, endOffset, predicate);\n }\n };\n _proto.onLevelUpdated = function onLevelUpdated(event, _ref2) {\n var _this = this;\n var details = _ref2.details;\n if (!this.media || !details.hasProgramDateTime || !this.hls.config.enableDateRangeMetadataCues) {\n return;\n }\n var dateRangeCuesAppended = this.dateRangeCuesAppended,\n id3Track = this.id3Track;\n var dateRanges = details.dateRanges;\n var ids = Object.keys(dateRanges);\n // Remove cues from track not found in details.dateRanges\n if (id3Track) {\n var idsToRemove = Object.keys(dateRangeCuesAppended).filter(function (id) {\n return !ids.includes(id);\n });\n var _loop = function _loop(i) {\n var id = idsToRemove[i];\n Object.keys(dateRangeCuesAppended[id].cues).forEach(function (key) {\n id3Track.removeCue(dateRangeCuesAppended[id].cues[key]);\n });\n delete dateRangeCuesAppended[id];\n };\n for (var i = idsToRemove.length; i--;) {\n _loop(i);\n }\n }\n // Exit if the playlist does not have Date Ranges or does not have Program Date Time\n var lastFragment = details.fragments[details.fragments.length - 1];\n if (ids.length === 0 || !(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(lastFragment === null || lastFragment === void 0 ? void 0 : lastFragment.programDateTime)) {\n return;\n }\n if (!this.id3Track) {\n this.id3Track = this.createTrack(this.media);\n }\n var dateTimeOffset = lastFragment.programDateTime / 1000 - lastFragment.start;\n var Cue = getCueClass();\n var _loop2 = function _loop2(_i) {\n var id = ids[_i];\n var dateRange = dateRanges[id];\n var appendedDateRangeCues = dateRangeCuesAppended[id];\n var cues = (appendedDateRangeCues === null || appendedDateRangeCues === void 0 ? void 0 : appendedDateRangeCues.cues) || {};\n var durationKnown = (appendedDateRangeCues === null || appendedDateRangeCues === void 0 ? void 0 : appendedDateRangeCues.durationKnown) || false;\n var startTime = dateRangeDateToTimelineSeconds(dateRange.startDate, dateTimeOffset);\n var endTime = MAX_CUE_ENDTIME;\n var endDate = dateRange.endDate;\n if (endDate) {\n endTime = dateRangeDateToTimelineSeconds(endDate, dateTimeOffset);\n durationKnown = true;\n } else if (dateRange.endOnNext && !durationKnown) {\n var nextDateRangeWithSameClass = ids.reduce(function (filterMapArray, id) {\n var candidate = dateRanges[id];\n if (candidate.class === dateRange.class && candidate.id !== id && candidate.startDate > dateRange.startDate) {\n filterMapArray.push(candidate);\n }\n return filterMapArray;\n }, []).sort(function (a, b) {\n return a.startDate.getTime() - b.startDate.getTime();\n })[0];\n if (nextDateRangeWithSameClass) {\n endTime = dateRangeDateToTimelineSeconds(nextDateRangeWithSameClass.startDate, dateTimeOffset);\n durationKnown = true;\n }\n }\n var attributes = Object.keys(dateRange.attr);\n for (var j = 0; j < attributes.length; j++) {\n var key = attributes[j];\n if (key === _loader_date_range__WEBPACK_IMPORTED_MODULE_4__.DateRangeAttribute.ID || key === _loader_date_range__WEBPACK_IMPORTED_MODULE_4__.DateRangeAttribute.CLASS || key === _loader_date_range__WEBPACK_IMPORTED_MODULE_4__.DateRangeAttribute.START_DATE || key === _loader_date_range__WEBPACK_IMPORTED_MODULE_4__.DateRangeAttribute.DURATION || key === _loader_date_range__WEBPACK_IMPORTED_MODULE_4__.DateRangeAttribute.END_DATE || key === _loader_date_range__WEBPACK_IMPORTED_MODULE_4__.DateRangeAttribute.END_ON_NEXT) {\n continue;\n }\n var cue = cues[key];\n if (cue) {\n if (durationKnown && !appendedDateRangeCues.durationKnown) {\n cue.endTime = endTime;\n }\n } else {\n var data = dateRange.attr[key];\n cue = new Cue(startTime, endTime, '');\n if (key === _loader_date_range__WEBPACK_IMPORTED_MODULE_4__.DateRangeAttribute.SCTE35_OUT || key === _loader_date_range__WEBPACK_IMPORTED_MODULE_4__.DateRangeAttribute.SCTE35_IN) {\n data = hexToArrayBuffer(data);\n }\n cue.value = {\n key: key,\n data: data\n };\n cue.type = _types_demuxer__WEBPACK_IMPORTED_MODULE_5__.MetadataSchema.dateRange;\n _this.id3Track.addCue(cue);\n cues[key] = cue;\n }\n }\n dateRangeCuesAppended[id] = {\n cues: cues,\n dateRange: dateRange,\n durationKnown: durationKnown\n };\n };\n for (var _i = 0; _i < ids.length; _i++) {\n _loop2(_i);\n }\n };\n return ID3TrackController;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ID3TrackController);\n\n/***/ }),\n\n/***/ \"./src/controller/latency-controller.ts\":\n/*!**********************************************!*\\\n !*** ./src/controller/latency-controller.ts ***!\n \\**********************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ LatencyController)\n/* harmony export */ });\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\nvar LatencyController = /*#__PURE__*/function () {\n function LatencyController(hls) {\n var _this = this;\n this.hls = void 0;\n this.config = void 0;\n this.media = null;\n this.levelDetails = null;\n this.currentTime = 0;\n this.stallCount = 0;\n this._latency = null;\n this.timeupdateHandler = function () {\n return _this.timeupdate();\n };\n this.hls = hls;\n this.config = hls.config;\n this.registerListeners();\n }\n var _proto = LatencyController.prototype;\n _proto.destroy = function destroy() {\n this.unregisterListeners();\n this.onMediaDetaching();\n this.levelDetails = null;\n // @ts-ignore\n this.hls = this.timeupdateHandler = null;\n };\n _proto.registerListeners = function registerListeners() {\n this.hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_ATTACHED, this.onMediaAttached, this);\n this.hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_DETACHING, this.onMediaDetaching, this);\n this.hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_LOADING, this.onManifestLoading, this);\n this.hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_UPDATED, this.onLevelUpdated, this);\n this.hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, this.onError, this);\n };\n _proto.unregisterListeners = function unregisterListeners() {\n this.hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_ATTACHED, this.onMediaAttached);\n this.hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MEDIA_DETACHING, this.onMediaDetaching);\n this.hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_LOADING, this.onManifestLoading);\n this.hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_UPDATED, this.onLevelUpdated);\n this.hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, this.onError);\n };\n _proto.onMediaAttached = function onMediaAttached(event, data) {\n this.media = data.media;\n this.media.addEventListener('timeupdate', this.timeupdateHandler);\n };\n _proto.onMediaDetaching = function onMediaDetaching() {\n if (this.media) {\n this.media.removeEventListener('timeupdate', this.timeupdateHandler);\n this.media = null;\n }\n };\n _proto.onManifestLoading = function onManifestLoading() {\n this.levelDetails = null;\n this._latency = null;\n this.stallCount = 0;\n };\n _proto.onLevelUpdated = function onLevelUpdated(event, _ref) {\n var details = _ref.details;\n this.levelDetails = details;\n if (details.advanced) {\n this.timeupdate();\n }\n if (!details.live && this.media) {\n this.media.removeEventListener('timeupdate', this.timeupdateHandler);\n }\n };\n _proto.onError = function onError(event, data) {\n if (data.details !== _errors__WEBPACK_IMPORTED_MODULE_0__.ErrorDetails.BUFFER_STALLED_ERROR) {\n return;\n }\n this.stallCount++;\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.warn('[playback-rate-controller]: Stall detected, adjusting target latency');\n };\n _proto.timeupdate = function timeupdate() {\n var media = this.media,\n levelDetails = this.levelDetails;\n if (!media || !levelDetails) {\n return;\n }\n this.currentTime = media.currentTime;\n var latency = this.computeLatency();\n if (latency === null) {\n return;\n }\n this._latency = latency;\n\n // Adapt playbackRate to meet target latency in low-latency mode\n var _this$config = this.config,\n lowLatencyMode = _this$config.lowLatencyMode,\n maxLiveSyncPlaybackRate = _this$config.maxLiveSyncPlaybackRate;\n if (!lowLatencyMode || maxLiveSyncPlaybackRate === 1) {\n return;\n }\n var targetLatency = this.targetLatency;\n if (targetLatency === null) {\n return;\n }\n var distanceFromTarget = latency - targetLatency;\n // Only adjust playbackRate when within one target duration of targetLatency\n // and more than one second from under-buffering.\n // Playback further than one target duration from target can be considered DVR playback.\n var liveMinLatencyDuration = Math.min(this.maxLatency, targetLatency + levelDetails.targetduration);\n var inLiveRange = distanceFromTarget < liveMinLatencyDuration;\n if (levelDetails.live && inLiveRange && distanceFromTarget > 0.05 && this.forwardBufferLength > 1) {\n var max = Math.min(2, Math.max(1.0, maxLiveSyncPlaybackRate));\n var rate = Math.round(2 / (1 + Math.exp(-0.75 * distanceFromTarget - this.edgeStalled)) * 20) / 20;\n media.playbackRate = Math.min(max, Math.max(1, rate));\n } else if (media.playbackRate !== 1 && media.playbackRate !== 0) {\n media.playbackRate = 1;\n }\n };\n _proto.estimateLiveEdge = function estimateLiveEdge() {\n var levelDetails = this.levelDetails;\n if (levelDetails === null) {\n return null;\n }\n return levelDetails.edge + levelDetails.age;\n };\n _proto.computeLatency = function computeLatency() {\n var liveEdge = this.estimateLiveEdge();\n if (liveEdge === null) {\n return null;\n }\n return liveEdge - this.currentTime;\n };\n _createClass(LatencyController, [{\n key: \"latency\",\n get: function get() {\n return this._latency || 0;\n }\n }, {\n key: \"maxLatency\",\n get: function get() {\n var config = this.config,\n levelDetails = this.levelDetails;\n if (config.liveMaxLatencyDuration !== undefined) {\n return config.liveMaxLatencyDuration;\n }\n return levelDetails ? config.liveMaxLatencyDurationCount * levelDetails.targetduration : 0;\n }\n }, {\n key: \"targetLatency\",\n get: function get() {\n var levelDetails = this.levelDetails;\n if (levelDetails === null) {\n return null;\n }\n var holdBack = levelDetails.holdBack,\n partHoldBack = levelDetails.partHoldBack,\n targetduration = levelDetails.targetduration;\n var _this$config2 = this.config,\n liveSyncDuration = _this$config2.liveSyncDuration,\n liveSyncDurationCount = _this$config2.liveSyncDurationCount,\n lowLatencyMode = _this$config2.lowLatencyMode;\n var userConfig = this.hls.userConfig;\n var targetLatency = lowLatencyMode ? partHoldBack || holdBack : holdBack;\n if (userConfig.liveSyncDuration || userConfig.liveSyncDurationCount || targetLatency === 0) {\n targetLatency = liveSyncDuration !== undefined ? liveSyncDuration : liveSyncDurationCount * targetduration;\n }\n var maxLiveSyncOnStallIncrease = targetduration;\n var liveSyncOnStallIncrease = 1.0;\n return targetLatency + Math.min(this.stallCount * liveSyncOnStallIncrease, maxLiveSyncOnStallIncrease);\n }\n }, {\n key: \"liveSyncPosition\",\n get: function get() {\n var liveEdge = this.estimateLiveEdge();\n var targetLatency = this.targetLatency;\n var levelDetails = this.levelDetails;\n if (liveEdge === null || targetLatency === null || levelDetails === null) {\n return null;\n }\n var edge = levelDetails.edge;\n var syncPosition = liveEdge - targetLatency - this.edgeStalled;\n var min = edge - levelDetails.totalduration;\n var max = edge - (this.config.lowLatencyMode && levelDetails.partTarget || levelDetails.targetduration);\n return Math.min(Math.max(min, syncPosition), max);\n }\n }, {\n key: \"drift\",\n get: function get() {\n var levelDetails = this.levelDetails;\n if (levelDetails === null) {\n return 1;\n }\n return levelDetails.drift;\n }\n }, {\n key: \"edgeStalled\",\n get: function get() {\n var levelDetails = this.levelDetails;\n if (levelDetails === null) {\n return 0;\n }\n var maxLevelUpdateAge = (this.config.lowLatencyMode && levelDetails.partTarget || levelDetails.targetduration) * 3;\n return Math.max(levelDetails.age - maxLevelUpdateAge, 0);\n }\n }, {\n key: \"forwardBufferLength\",\n get: function get() {\n var media = this.media,\n levelDetails = this.levelDetails;\n if (!media || !levelDetails) {\n return 0;\n }\n var bufferedRanges = media.buffered.length;\n return (bufferedRanges ? media.buffered.end(bufferedRanges - 1) : levelDetails.edge) - this.currentTime;\n }\n }]);\n return LatencyController;\n}();\n\n\n/***/ }),\n\n/***/ \"./src/controller/level-controller.ts\":\n/*!********************************************!*\\\n !*** ./src/controller/level-controller.ts ***!\n \\********************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ LevelController)\n/* harmony export */ });\n/* harmony import */ var _types_level__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types/level */ \"./src/types/level.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _utils_codecs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/codecs */ \"./src/utils/codecs.ts\");\n/* harmony import */ var _level_helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./level-helper */ \"./src/controller/level-helper.ts\");\n/* harmony import */ var _base_playlist_controller__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./base-playlist-controller */ \"./src/controller/base-playlist-controller.ts\");\n/* harmony import */ var _types_loader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../types/loader */ \"./src/types/loader.ts\");\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n/*\n * Level Controller\n */\n\n\n\n\n\n\n\n\nvar chromeOrFirefox = /chrome|firefox/.test(navigator.userAgent.toLowerCase());\nvar LevelController = /*#__PURE__*/function (_BasePlaylistControll) {\n _inheritsLoose(LevelController, _BasePlaylistControll);\n function LevelController(hls) {\n var _this;\n _this = _BasePlaylistControll.call(this, hls, '[level-controller]') || this;\n _this._levels = [];\n _this._firstLevel = -1;\n _this._startLevel = void 0;\n _this.currentLevelIndex = -1;\n _this.manualLevelIndex = -1;\n _this.onParsedComplete = void 0;\n _this._registerListeners();\n return _this;\n }\n var _proto = LevelController.prototype;\n _proto._registerListeners = function _registerListeners() {\n var hls = this.hls;\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_LOADED, this.onManifestLoaded, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_LOADED, this.onLevelLoaded, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.AUDIO_TRACK_SWITCHED, this.onAudioTrackSwitched, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.FRAG_LOADED, this.onFragLoaded, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, this.onError, this);\n };\n _proto._unregisterListeners = function _unregisterListeners() {\n var hls = this.hls;\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_LOADED, this.onManifestLoaded, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_LOADED, this.onLevelLoaded, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.AUDIO_TRACK_SWITCHED, this.onAudioTrackSwitched, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.FRAG_LOADED, this.onFragLoaded, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, this.onError, this);\n };\n _proto.destroy = function destroy() {\n this._unregisterListeners();\n this.manualLevelIndex = -1;\n this._levels.length = 0;\n _BasePlaylistControll.prototype.destroy.call(this);\n };\n _proto.startLoad = function startLoad() {\n var levels = this._levels;\n\n // clean up live level details to force reload them, and reset load errors\n levels.forEach(function (level) {\n level.loadError = 0;\n });\n _BasePlaylistControll.prototype.startLoad.call(this);\n };\n _proto.onManifestLoaded = function onManifestLoaded(event, data) {\n var levels = [];\n var audioTracks = [];\n var subtitleTracks = [];\n var bitrateStart;\n var levelSet = {};\n var levelFromSet;\n var resolutionFound = false;\n var videoCodecFound = false;\n var audioCodecFound = false;\n\n // regroup redundant levels together\n data.levels.forEach(function (levelParsed) {\n var attributes = levelParsed.attrs;\n resolutionFound = resolutionFound || !!(levelParsed.width && levelParsed.height);\n videoCodecFound = videoCodecFound || !!levelParsed.videoCodec;\n audioCodecFound = audioCodecFound || !!levelParsed.audioCodec;\n\n // erase audio codec info if browser does not support mp4a.40.34.\n // demuxer will autodetect codec and fallback to mpeg/audio\n if (chromeOrFirefox && levelParsed.audioCodec && levelParsed.audioCodec.indexOf('mp4a.40.34') !== -1) {\n levelParsed.audioCodec = undefined;\n }\n var levelKey = levelParsed.bitrate + \"-\" + levelParsed.attrs.RESOLUTION + \"-\" + levelParsed.attrs.CODECS;\n levelFromSet = levelSet[levelKey];\n if (!levelFromSet) {\n levelFromSet = new _types_level__WEBPACK_IMPORTED_MODULE_0__.Level(levelParsed);\n levelSet[levelKey] = levelFromSet;\n levels.push(levelFromSet);\n } else {\n levelFromSet.url.push(levelParsed.url);\n }\n if (attributes) {\n if (attributes.AUDIO) {\n (0,_level_helper__WEBPACK_IMPORTED_MODULE_4__.addGroupId)(levelFromSet, 'audio', attributes.AUDIO);\n }\n if (attributes.SUBTITLES) {\n (0,_level_helper__WEBPACK_IMPORTED_MODULE_4__.addGroupId)(levelFromSet, 'text', attributes.SUBTITLES);\n }\n }\n });\n\n // remove audio-only level if we also have levels with video codecs or RESOLUTION signalled\n if ((resolutionFound || videoCodecFound) && audioCodecFound) {\n levels = levels.filter(function (_ref) {\n var videoCodec = _ref.videoCodec,\n width = _ref.width,\n height = _ref.height;\n return !!videoCodec || !!(width && height);\n });\n }\n\n // only keep levels with supported audio/video codecs\n levels = levels.filter(function (_ref2) {\n var audioCodec = _ref2.audioCodec,\n videoCodec = _ref2.videoCodec;\n return (!audioCodec || (0,_utils_codecs__WEBPACK_IMPORTED_MODULE_3__.isCodecSupportedInMp4)(audioCodec, 'audio')) && (!videoCodec || (0,_utils_codecs__WEBPACK_IMPORTED_MODULE_3__.isCodecSupportedInMp4)(videoCodec, 'video'));\n });\n if (data.audioTracks) {\n audioTracks = data.audioTracks.filter(function (track) {\n return !track.audioCodec || (0,_utils_codecs__WEBPACK_IMPORTED_MODULE_3__.isCodecSupportedInMp4)(track.audioCodec, 'audio');\n });\n // Assign ids after filtering as array indices by group-id\n (0,_level_helper__WEBPACK_IMPORTED_MODULE_4__.assignTrackIdsByGroup)(audioTracks);\n }\n if (data.subtitles) {\n subtitleTracks = data.subtitles;\n (0,_level_helper__WEBPACK_IMPORTED_MODULE_4__.assignTrackIdsByGroup)(subtitleTracks);\n }\n if (levels.length > 0) {\n // start bitrate is the first bitrate of the manifest\n bitrateStart = levels[0].bitrate;\n // sort levels from lowest to highest\n levels.sort(function (a, b) {\n if (a.attrs['HDCP-LEVEL'] !== b.attrs['HDCP-LEVEL']) {\n return (a.attrs['HDCP-LEVEL'] || '') > (b.attrs['HDCP-LEVEL'] || '') ? 1 : -1;\n }\n if (a.bitrate !== b.bitrate) {\n return a.bitrate - b.bitrate;\n }\n if (a.attrs.SCORE !== b.attrs.SCORE) {\n return a.attrs.decimalFloatingPoint('SCORE') - b.attrs.decimalFloatingPoint('SCORE');\n }\n if (resolutionFound && a.height !== b.height) {\n return a.height - b.height;\n }\n return 0;\n });\n this._levels = levels;\n // find index of first level in sorted levels\n for (var i = 0; i < levels.length; i++) {\n if (levels[i].bitrate === bitrateStart) {\n this._firstLevel = i;\n this.log(\"manifest loaded, \" + levels.length + \" level(s) found, first bitrate: \" + bitrateStart);\n break;\n }\n }\n\n // Audio is only alternate if manifest include a URI along with the audio group tag,\n // and this is not an audio-only stream where levels contain audio-only\n var audioOnly = audioCodecFound && !videoCodecFound;\n var edata = {\n levels: levels,\n audioTracks: audioTracks,\n subtitleTracks: subtitleTracks,\n sessionData: data.sessionData,\n sessionKeys: data.sessionKeys,\n firstLevel: this._firstLevel,\n stats: data.stats,\n audio: audioCodecFound,\n video: videoCodecFound,\n altAudio: !audioOnly && audioTracks.some(function (t) {\n return !!t.url;\n })\n };\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_PARSED, edata);\n\n // Initiate loading after all controllers have received MANIFEST_PARSED\n if (this.hls.config.autoStartLoad || this.hls.forceStartLoad) {\n this.hls.startLoad(this.hls.config.startPosition);\n }\n } else {\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,\n fatal: true,\n url: data.url,\n reason: 'no level with compatible codecs found in manifest'\n });\n }\n };\n _proto.onError = function onError(event, data) {\n var _data$frag, _data$level;\n _BasePlaylistControll.prototype.onError.call(this, event, data);\n if (data.fatal) {\n return;\n }\n\n // Switch to redundant level when track fails to load\n var context = data.context;\n var level = this._levels[this.currentLevelIndex];\n if (context && (context.type === _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistContextType.AUDIO_TRACK && level.audioGroupIds && context.groupId === level.audioGroupIds[level.urlId] || context.type === _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistContextType.SUBTITLE_TRACK && level.textGroupIds && context.groupId === level.textGroupIds[level.urlId])) {\n this.redundantFailover(this.currentLevelIndex);\n return;\n }\n var levelError = false;\n var levelSwitch = true;\n var levelIndex;\n\n // try to recover not fatal errors\n switch (data.details) {\n case _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.KEY_LOAD_ERROR:\n case _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.KEY_LOAD_TIMEOUT:\n if (data.frag) {\n // Share fragment error count accross media options (main, audio, subs)\n // This allows for level based rendition switching when media option assets fail\n var variantLevelIndex = data.frag.type === _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN ? data.frag.level : this.currentLevelIndex;\n var _level = this._levels[variantLevelIndex];\n // Set levelIndex when we're out of fragment retries\n if (_level) {\n _level.fragmentError++;\n if (_level.fragmentError > this.hls.config.fragLoadingMaxRetry) {\n levelIndex = variantLevelIndex;\n }\n } else {\n levelIndex = variantLevelIndex;\n }\n }\n break;\n case _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:\n {\n var restrictedHdcpLevel = level.attrs['HDCP-LEVEL'];\n if (restrictedHdcpLevel) {\n this.hls.maxHdcpLevel = _types_level__WEBPACK_IMPORTED_MODULE_0__.HdcpLevels[_types_level__WEBPACK_IMPORTED_MODULE_0__.HdcpLevels.indexOf(restrictedHdcpLevel) - 1];\n this.warn(\"Restricting playback to HDCP-LEVEL of \\\"\" + this.hls.maxHdcpLevel + \"\\\" or lower\");\n }\n }\n // eslint-disable-next-line no-fallthrough\n case _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.FRAG_PARSING_ERROR:\n case _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.KEY_SYSTEM_NO_SESSION:\n levelIndex = ((_data$frag = data.frag) === null || _data$frag === void 0 ? void 0 : _data$frag.type) === _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN ? data.frag.level : this.currentLevelIndex;\n // Do not retry level. Escalate to fatal if switching levels fails.\n data.levelRetry = false;\n break;\n case _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.LEVEL_LOAD_ERROR:\n case _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n // Do not perform level switch if an error occurred using delivery directives\n // Attempt to reload level without directives first\n if (context) {\n if (context.deliveryDirectives) {\n levelSwitch = false;\n }\n levelIndex = context.level;\n }\n levelError = true;\n break;\n case _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.REMUX_ALLOC_ERROR:\n levelIndex = (_data$level = data.level) != null ? _data$level : this.currentLevelIndex;\n levelError = true;\n break;\n }\n if (levelIndex !== undefined) {\n this.recoverLevel(data, levelIndex, levelError, levelSwitch);\n }\n }\n\n /**\n * Switch to a redundant stream if any available.\n * If redundant stream is not available, emergency switch down if ABR mode is enabled.\n */;\n _proto.recoverLevel = function recoverLevel(errorEvent, levelIndex, levelError, levelSwitch) {\n var errorDetails = errorEvent.details;\n var level = this._levels[levelIndex];\n level.loadError++;\n if (levelError) {\n var retrying = this.retryLoadingOrFail(errorEvent);\n if (retrying) {\n // boolean used to inform stream controller not to switch back to IDLE on non fatal error\n errorEvent.levelRetry = true;\n } else {\n this.currentLevelIndex = -1;\n return;\n }\n }\n if (levelSwitch) {\n var redundantLevels = level.url.length;\n // Try redundant fail-over until level.loadError reaches redundantLevels\n if (redundantLevels > 1 && level.loadError < redundantLevels) {\n errorEvent.levelRetry = true;\n this.redundantFailover(levelIndex);\n } else if (this.manualLevelIndex === -1) {\n // Search for next level to retry\n var nextLevel = -1;\n var levels = this._levels;\n for (var i = levels.length; i--;) {\n var candidate = (i + this.currentLevelIndex) % levels.length;\n if (candidate !== this.currentLevelIndex && levels[candidate].loadError === 0) {\n nextLevel = candidate;\n break;\n }\n }\n if (nextLevel > -1 && this.currentLevelIndex !== nextLevel) {\n this.warn(errorDetails + \": switch to \" + nextLevel);\n errorEvent.levelRetry = true;\n this.hls.nextAutoLevel = nextLevel;\n } else if (errorEvent.levelRetry === false) {\n // No levels to switch to and no more retries\n errorEvent.fatal = true;\n }\n }\n }\n };\n _proto.redundantFailover = function redundantFailover(levelIndex) {\n var level = this._levels[levelIndex];\n var redundantLevels = level.url.length;\n if (redundantLevels > 1) {\n // Update the url id of all levels so that we stay on the same set of variants when level switching\n var newUrlId = (level.urlId + 1) % redundantLevels;\n this.warn(\"Switching to redundant URL-id \" + newUrlId);\n this._levels.forEach(function (level) {\n level.urlId = newUrlId;\n });\n this.level = levelIndex;\n }\n }\n\n // reset errors on the successful load of a fragment\n ;\n _proto.onFragLoaded = function onFragLoaded(event, _ref3) {\n var frag = _ref3.frag;\n if (frag !== undefined && frag.type === _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN) {\n var level = this._levels[frag.level];\n if (level !== undefined) {\n level.fragmentError = 0;\n level.loadError = 0;\n }\n }\n };\n _proto.onLevelLoaded = function onLevelLoaded(event, data) {\n var _data$deliveryDirecti2;\n var level = data.level,\n details = data.details;\n var curLevel = this._levels[level];\n if (!curLevel) {\n var _data$deliveryDirecti;\n this.warn(\"Invalid level index \" + level);\n if ((_data$deliveryDirecti = data.deliveryDirectives) !== null && _data$deliveryDirecti !== void 0 && _data$deliveryDirecti.skip) {\n details.deltaUpdateFailed = true;\n }\n return;\n }\n\n // only process level loaded events matching with expected level\n if (level === this.currentLevelIndex) {\n // reset level load error counter on successful level loaded only if there is no issues with fragments\n if (curLevel.fragmentError === 0) {\n curLevel.loadError = 0;\n this.retryCount = 0;\n }\n this.playlistLoaded(level, data, curLevel.details);\n } else if ((_data$deliveryDirecti2 = data.deliveryDirectives) !== null && _data$deliveryDirecti2 !== void 0 && _data$deliveryDirecti2.skip) {\n // received a delta playlist update that cannot be merged\n details.deltaUpdateFailed = true;\n }\n };\n _proto.onAudioTrackSwitched = function onAudioTrackSwitched(event, data) {\n var currentLevel = this.hls.levels[this.currentLevelIndex];\n if (!currentLevel) {\n return;\n }\n if (currentLevel.audioGroupIds) {\n var urlId = -1;\n var audioGroupId = this.hls.audioTracks[data.id].groupId;\n for (var i = 0; i < currentLevel.audioGroupIds.length; i++) {\n if (currentLevel.audioGroupIds[i] === audioGroupId) {\n urlId = i;\n break;\n }\n }\n if (urlId !== currentLevel.urlId) {\n currentLevel.urlId = urlId;\n this.startLoad();\n }\n }\n };\n _proto.loadPlaylist = function loadPlaylist(hlsUrlParameters) {\n _BasePlaylistControll.prototype.loadPlaylist.call(this);\n var level = this.currentLevelIndex;\n var currentLevel = this._levels[level];\n if (this.canLoad && currentLevel && currentLevel.url.length > 0) {\n var id = currentLevel.urlId;\n var url = currentLevel.url[id];\n if (hlsUrlParameters) {\n try {\n url = hlsUrlParameters.addDirectives(url);\n } catch (error) {\n this.warn(\"Could not construct new URL with HLS Delivery Directives: \" + error);\n }\n }\n this.log(\"Attempt loading level index \" + level + ((hlsUrlParameters === null || hlsUrlParameters === void 0 ? void 0 : hlsUrlParameters.msn) !== undefined ? ' at sn ' + hlsUrlParameters.msn + ' part ' + hlsUrlParameters.part : '') + \" with URL-id \" + id + \" \" + url);\n\n // console.log('Current audio track group ID:', this.hls.audioTracks[this.hls.audioTrack].groupId);\n // console.log('New video quality level audio group id:', levelObject.attrs.AUDIO, level);\n this.clearTimer();\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_LOADING, {\n url: url,\n level: level,\n id: id,\n deliveryDirectives: hlsUrlParameters || null\n });\n }\n };\n _proto.removeLevel = function removeLevel(levelIndex, urlId) {\n var filterLevelAndGroupByIdIndex = function filterLevelAndGroupByIdIndex(url, id) {\n return id !== urlId;\n };\n var levels = this._levels.filter(function (level, index) {\n if (index !== levelIndex) {\n return true;\n }\n if (level.url.length > 1 && urlId !== undefined) {\n level.url = level.url.filter(filterLevelAndGroupByIdIndex);\n if (level.audioGroupIds) {\n level.audioGroupIds = level.audioGroupIds.filter(filterLevelAndGroupByIdIndex);\n }\n if (level.textGroupIds) {\n level.textGroupIds = level.textGroupIds.filter(filterLevelAndGroupByIdIndex);\n }\n level.urlId = 0;\n return true;\n }\n return false;\n }).map(function (level, index) {\n var details = level.details;\n if (details !== null && details !== void 0 && details.fragments) {\n details.fragments.forEach(function (fragment) {\n fragment.level = index;\n });\n }\n return level;\n });\n this._levels = levels;\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVELS_UPDATED, {\n levels: levels\n });\n };\n _createClass(LevelController, [{\n key: \"levels\",\n get: function get() {\n if (this._levels.length === 0) {\n return null;\n }\n return this._levels;\n }\n }, {\n key: \"level\",\n get: function get() {\n return this.currentLevelIndex;\n },\n set: function set(newLevel) {\n var _levels$newLevel;\n var levels = this._levels;\n if (levels.length === 0) {\n return;\n }\n if (this.currentLevelIndex === newLevel && (_levels$newLevel = levels[newLevel]) !== null && _levels$newLevel !== void 0 && _levels$newLevel.details) {\n return;\n }\n // check if level idx is valid\n if (newLevel < 0 || newLevel >= levels.length) {\n // invalid level id given, trigger error\n var fatal = newLevel < 0;\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorTypes.OTHER_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.LEVEL_SWITCH_ERROR,\n level: newLevel,\n fatal: fatal,\n reason: 'invalid level idx'\n });\n if (fatal) {\n return;\n }\n newLevel = Math.min(newLevel, levels.length - 1);\n }\n\n // stopping live reloading timer if any\n this.clearTimer();\n var lastLevelIndex = this.currentLevelIndex;\n var lastLevel = levels[lastLevelIndex];\n var level = levels[newLevel];\n this.log(\"switching to level \" + newLevel + \" from \" + lastLevelIndex);\n this.currentLevelIndex = newLevel;\n var levelSwitchingData = _extends({}, level, {\n level: newLevel,\n maxBitrate: level.maxBitrate,\n uri: level.uri,\n urlId: level.urlId\n });\n // @ts-ignore\n delete levelSwitchingData._urlId;\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_SWITCHING, levelSwitchingData);\n // check if we need to load playlist for this level\n var levelDetails = level.details;\n if (!levelDetails || levelDetails.live) {\n // level not retrieved yet, or live playlist we need to (re)load it\n var hlsUrlParameters = this.switchParams(level.uri, lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.details);\n this.loadPlaylist(hlsUrlParameters);\n }\n }\n }, {\n key: \"manualLevel\",\n get: function get() {\n return this.manualLevelIndex;\n },\n set: function set(newLevel) {\n this.manualLevelIndex = newLevel;\n if (this._startLevel === undefined) {\n this._startLevel = newLevel;\n }\n if (newLevel !== -1) {\n this.level = newLevel;\n }\n }\n }, {\n key: \"firstLevel\",\n get: function get() {\n return this._firstLevel;\n },\n set: function set(newLevel) {\n this._firstLevel = newLevel;\n }\n }, {\n key: \"startLevel\",\n get: function get() {\n // hls.startLevel takes precedence over config.startLevel\n // if none of these values are defined, fallback on this._firstLevel (first quality level appearing in variant manifest)\n if (this._startLevel === undefined) {\n var configStartLevel = this.hls.config.startLevel;\n if (configStartLevel !== undefined) {\n return configStartLevel;\n } else {\n return this._firstLevel;\n }\n } else {\n return this._startLevel;\n }\n },\n set: function set(newLevel) {\n this._startLevel = newLevel;\n }\n }, {\n key: \"nextLoadLevel\",\n get: function get() {\n if (this.manualLevelIndex !== -1) {\n return this.manualLevelIndex;\n } else {\n return this.hls.nextAutoLevel;\n }\n },\n set: function set(nextLevel) {\n this.level = nextLevel;\n if (this.manualLevelIndex === -1) {\n this.hls.nextAutoLevel = nextLevel;\n }\n }\n }]);\n return LevelController;\n}(_base_playlist_controller__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n\n\n/***/ }),\n\n/***/ \"./src/controller/level-helper.ts\":\n/*!****************************************!*\\\n !*** ./src/controller/level-helper.ts ***!\n \\****************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"addGroupId\": () => (/* binding */ addGroupId),\n/* harmony export */ \"addSliding\": () => (/* binding */ addSliding),\n/* harmony export */ \"adjustSliding\": () => (/* binding */ adjustSliding),\n/* harmony export */ \"assignTrackIdsByGroup\": () => (/* binding */ assignTrackIdsByGroup),\n/* harmony export */ \"computeReloadInterval\": () => (/* binding */ computeReloadInterval),\n/* harmony export */ \"getFragmentWithSN\": () => (/* binding */ getFragmentWithSN),\n/* harmony export */ \"getPartWith\": () => (/* binding */ getPartWith),\n/* harmony export */ \"mapFragmentIntersection\": () => (/* binding */ mapFragmentIntersection),\n/* harmony export */ \"mapPartIntersection\": () => (/* binding */ mapPartIntersection),\n/* harmony export */ \"mergeDetails\": () => (/* binding */ mergeDetails),\n/* harmony export */ \"updateFragPTSDTS\": () => (/* binding */ updateFragPTSDTS),\n/* harmony export */ \"updatePTS\": () => (/* binding */ updatePTS)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _loader_date_range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../loader/date-range */ \"./src/loader/date-range.ts\");\n\n\n\n\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n/**\n * @module LevelHelper\n * Providing methods dealing with playlist sliding and drift\n * */\n\n\n\nfunction addGroupId(level, type, id) {\n switch (type) {\n case 'audio':\n if (!level.audioGroupIds) {\n level.audioGroupIds = [];\n }\n level.audioGroupIds.push(id);\n break;\n case 'text':\n if (!level.textGroupIds) {\n level.textGroupIds = [];\n }\n level.textGroupIds.push(id);\n break;\n }\n}\nfunction assignTrackIdsByGroup(tracks) {\n var groups = {};\n tracks.forEach(function (track) {\n var groupId = track.groupId || '';\n track.id = groups[groupId] = groups[groupId] || 0;\n groups[groupId]++;\n });\n}\nfunction updatePTS(fragments, fromIdx, toIdx) {\n var fragFrom = fragments[fromIdx];\n var fragTo = fragments[toIdx];\n updateFromToPTS(fragFrom, fragTo);\n}\nfunction updateFromToPTS(fragFrom, fragTo) {\n var fragToPTS = fragTo.startPTS;\n // if we know startPTS[toIdx]\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(fragToPTS)) {\n // update fragment duration.\n // it helps to fix drifts between playlist reported duration and fragment real duration\n var duration = 0;\n var frag;\n if (fragTo.sn > fragFrom.sn) {\n duration = fragToPTS - fragFrom.start;\n frag = fragFrom;\n } else {\n duration = fragFrom.start - fragToPTS;\n frag = fragTo;\n }\n // TODO? Drift can go either way, or the playlist could be completely accurate\n // console.assert(duration > 0,\n // `duration of ${duration} computed for frag ${frag.sn}, level ${frag.level}, there should be some duration drift between playlist and fragment!`);\n if (frag.duration !== duration) {\n frag.duration = duration;\n }\n // we dont know startPTS[toIdx]\n } else if (fragTo.sn > fragFrom.sn) {\n var contiguous = fragFrom.cc === fragTo.cc;\n // TODO: With part-loading end/durations we need to confirm the whole fragment is loaded before using (or setting) minEndPTS\n if (contiguous && fragFrom.minEndPTS) {\n fragTo.start = fragFrom.start + (fragFrom.minEndPTS - fragFrom.start);\n } else {\n fragTo.start = fragFrom.start + fragFrom.duration;\n }\n } else {\n fragTo.start = Math.max(fragFrom.start - fragTo.duration, 0);\n }\n}\nfunction updateFragPTSDTS(details, frag, startPTS, endPTS, startDTS, endDTS) {\n var parsedMediaDuration = endPTS - startPTS;\n if (parsedMediaDuration <= 0) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_1__.logger.warn('Fragment should have a positive duration', frag);\n endPTS = startPTS + frag.duration;\n endDTS = startDTS + frag.duration;\n }\n var maxStartPTS = startPTS;\n var minEndPTS = endPTS;\n var fragStartPts = frag.startPTS;\n var fragEndPts = frag.endPTS;\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(fragStartPts)) {\n // delta PTS between audio and video\n var deltaPTS = Math.abs(fragStartPts - startPTS);\n if (!(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(frag.deltaPTS)) {\n frag.deltaPTS = deltaPTS;\n } else {\n frag.deltaPTS = Math.max(deltaPTS, frag.deltaPTS);\n }\n maxStartPTS = Math.max(startPTS, fragStartPts);\n startPTS = Math.min(startPTS, fragStartPts);\n startDTS = Math.min(startDTS, frag.startDTS);\n minEndPTS = Math.min(endPTS, fragEndPts);\n endPTS = Math.max(endPTS, fragEndPts);\n endDTS = Math.max(endDTS, frag.endDTS);\n }\n frag.duration = endPTS - startPTS;\n var drift = startPTS - frag.start;\n frag.start = frag.startPTS = startPTS;\n frag.maxStartPTS = maxStartPTS;\n frag.startDTS = startDTS;\n frag.endPTS = endPTS;\n frag.minEndPTS = minEndPTS;\n frag.endDTS = endDTS;\n var sn = frag.sn; // 'initSegment'\n // exit if sn out of range\n if (!details || sn < details.startSN || sn > details.endSN) {\n return 0;\n }\n var i;\n var fragIdx = sn - details.startSN;\n var fragments = details.fragments;\n // update frag reference in fragments array\n // rationale is that fragments array might not contain this frag object.\n // this will happen if playlist has been refreshed between frag loading and call to updateFragPTSDTS()\n // if we don't update frag, we won't be able to propagate PTS info on the playlist\n // resulting in invalid sliding computation\n fragments[fragIdx] = frag;\n // adjust fragment PTS/duration from seqnum-1 to frag 0\n for (i = fragIdx; i > 0; i--) {\n updateFromToPTS(fragments[i], fragments[i - 1]);\n }\n\n // adjust fragment PTS/duration from seqnum to last frag\n for (i = fragIdx; i < fragments.length - 1; i++) {\n updateFromToPTS(fragments[i], fragments[i + 1]);\n }\n if (details.fragmentHint) {\n updateFromToPTS(fragments[fragments.length - 1], details.fragmentHint);\n }\n details.PTSKnown = details.alignedSliding = true;\n return drift;\n}\nfunction mergeDetails(oldDetails, newDetails) {\n // Track the last initSegment processed. Initialize it to the last one on the timeline.\n var currentInitSegment = null;\n var oldFragments = oldDetails.fragments;\n for (var i = oldFragments.length - 1; i >= 0; i--) {\n var oldInit = oldFragments[i].initSegment;\n if (oldInit) {\n currentInitSegment = oldInit;\n break;\n }\n }\n if (oldDetails.fragmentHint) {\n // prevent PTS and duration from being adjusted on the next hint\n delete oldDetails.fragmentHint.endPTS;\n }\n // check if old/new playlists have fragments in common\n // loop through overlapping SN and update startPTS , cc, and duration if any found\n var ccOffset = 0;\n var PTSFrag;\n mapFragmentIntersection(oldDetails, newDetails, function (oldFrag, newFrag) {\n if (oldFrag.relurl) {\n // Do not compare CC if the old fragment has no url. This is a level.fragmentHint used by LL-HLS parts.\n // It maybe be off by 1 if it was created before any parts or discontinuity tags were appended to the end\n // of the playlist.\n ccOffset = oldFrag.cc - newFrag.cc;\n }\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(oldFrag.startPTS) && (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(oldFrag.endPTS)) {\n newFrag.start = newFrag.startPTS = oldFrag.startPTS;\n newFrag.startDTS = oldFrag.startDTS;\n newFrag.appendedPTS = oldFrag.appendedPTS;\n newFrag.maxStartPTS = oldFrag.maxStartPTS;\n newFrag.endPTS = oldFrag.endPTS;\n newFrag.endDTS = oldFrag.endDTS;\n newFrag.minEndPTS = oldFrag.minEndPTS;\n newFrag.duration = oldFrag.endPTS - oldFrag.startPTS;\n if (newFrag.duration) {\n PTSFrag = newFrag;\n }\n\n // PTS is known when any segment has startPTS and endPTS\n newDetails.PTSKnown = newDetails.alignedSliding = true;\n }\n newFrag.elementaryStreams = oldFrag.elementaryStreams;\n newFrag.loader = oldFrag.loader;\n newFrag.stats = oldFrag.stats;\n newFrag.urlId = oldFrag.urlId;\n if (oldFrag.initSegment) {\n newFrag.initSegment = oldFrag.initSegment;\n currentInitSegment = oldFrag.initSegment;\n }\n });\n if (currentInitSegment) {\n var fragmentsToCheck = newDetails.fragmentHint ? newDetails.fragments.concat(newDetails.fragmentHint) : newDetails.fragments;\n fragmentsToCheck.forEach(function (frag) {\n var _currentInitSegment;\n if (!frag.initSegment || frag.initSegment.relurl === ((_currentInitSegment = currentInitSegment) === null || _currentInitSegment === void 0 ? void 0 : _currentInitSegment.relurl)) {\n frag.initSegment = currentInitSegment;\n }\n });\n }\n if (newDetails.skippedSegments) {\n newDetails.deltaUpdateFailed = newDetails.fragments.some(function (frag) {\n return !frag;\n });\n if (newDetails.deltaUpdateFailed) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_1__.logger.warn('[level-helper] Previous playlist missing segments skipped in delta playlist');\n for (var _i = newDetails.skippedSegments; _i--;) {\n newDetails.fragments.shift();\n }\n newDetails.startSN = newDetails.fragments[0].sn;\n newDetails.startCC = newDetails.fragments[0].cc;\n } else if (newDetails.canSkipDateRanges) {\n newDetails.dateRanges = mergeDateRanges(oldDetails.dateRanges, newDetails.dateRanges, newDetails.recentlyRemovedDateranges);\n }\n }\n var newFragments = newDetails.fragments;\n if (ccOffset) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_1__.logger.warn('discontinuity sliding from playlist, take drift into account');\n for (var _i2 = 0; _i2 < newFragments.length; _i2++) {\n newFragments[_i2].cc += ccOffset;\n }\n }\n if (newDetails.skippedSegments) {\n newDetails.startCC = newDetails.fragments[0].cc;\n }\n\n // Merge parts\n mapPartIntersection(oldDetails.partList, newDetails.partList, function (oldPart, newPart) {\n newPart.elementaryStreams = oldPart.elementaryStreams;\n newPart.stats = oldPart.stats;\n });\n\n // if at least one fragment contains PTS info, recompute PTS information for all fragments\n if (PTSFrag) {\n updateFragPTSDTS(newDetails, PTSFrag, PTSFrag.startPTS, PTSFrag.endPTS, PTSFrag.startDTS, PTSFrag.endDTS);\n } else {\n // ensure that delta is within oldFragments range\n // also adjust sliding in case delta is 0 (we could have old=[50-60] and new=old=[50-61])\n // in that case we also need to adjust start offset of all fragments\n adjustSliding(oldDetails, newDetails);\n }\n if (newFragments.length) {\n newDetails.totalduration = newDetails.edge - newFragments[0].start;\n }\n newDetails.driftStartTime = oldDetails.driftStartTime;\n newDetails.driftStart = oldDetails.driftStart;\n var advancedDateTime = newDetails.advancedDateTime;\n if (newDetails.advanced && advancedDateTime) {\n var edge = newDetails.edge;\n if (!newDetails.driftStart) {\n newDetails.driftStartTime = advancedDateTime;\n newDetails.driftStart = edge;\n }\n newDetails.driftEndTime = advancedDateTime;\n newDetails.driftEnd = edge;\n } else {\n newDetails.driftEndTime = oldDetails.driftEndTime;\n newDetails.driftEnd = oldDetails.driftEnd;\n newDetails.advancedDateTime = oldDetails.advancedDateTime;\n }\n}\nfunction mergeDateRanges(oldDateRanges, deltaDateRanges, recentlyRemovedDateranges) {\n var dateRanges = _extends({}, oldDateRanges);\n if (recentlyRemovedDateranges) {\n recentlyRemovedDateranges.forEach(function (id) {\n delete dateRanges[id];\n });\n }\n Object.keys(deltaDateRanges).forEach(function (id) {\n var dateRange = new _loader_date_range__WEBPACK_IMPORTED_MODULE_2__.DateRange(deltaDateRanges[id].attr, dateRanges[id]);\n if (dateRange.isValid) {\n dateRanges[id] = dateRange;\n } else {\n _utils_logger__WEBPACK_IMPORTED_MODULE_1__.logger.warn(\"Ignoring invalid Playlist Delta Update DATERANGE tag: \\\"\" + JSON.stringify(deltaDateRanges[id].attr) + \"\\\"\");\n }\n });\n return dateRanges;\n}\nfunction mapPartIntersection(oldParts, newParts, intersectionFn) {\n if (oldParts && newParts) {\n var delta = 0;\n for (var i = 0, len = oldParts.length; i <= len; i++) {\n var _oldPart = oldParts[i];\n var _newPart = newParts[i + delta];\n if (_oldPart && _newPart && _oldPart.index === _newPart.index && _oldPart.fragment.sn === _newPart.fragment.sn) {\n intersectionFn(_oldPart, _newPart);\n } else {\n delta--;\n }\n }\n }\n}\nfunction mapFragmentIntersection(oldDetails, newDetails, intersectionFn) {\n var skippedSegments = newDetails.skippedSegments;\n var start = Math.max(oldDetails.startSN, newDetails.startSN) - newDetails.startSN;\n var end = (oldDetails.fragmentHint ? 1 : 0) + (skippedSegments ? newDetails.endSN : Math.min(oldDetails.endSN, newDetails.endSN)) - newDetails.startSN;\n var delta = newDetails.startSN - oldDetails.startSN;\n var newFrags = newDetails.fragmentHint ? newDetails.fragments.concat(newDetails.fragmentHint) : newDetails.fragments;\n var oldFrags = oldDetails.fragmentHint ? oldDetails.fragments.concat(oldDetails.fragmentHint) : oldDetails.fragments;\n for (var i = start; i <= end; i++) {\n var _oldFrag = oldFrags[delta + i];\n var _newFrag = newFrags[i];\n if (skippedSegments && !_newFrag && i < skippedSegments) {\n // Fill in skipped segments in delta playlist\n _newFrag = newDetails.fragments[i] = _oldFrag;\n }\n if (_oldFrag && _newFrag) {\n intersectionFn(_oldFrag, _newFrag);\n }\n }\n}\nfunction adjustSliding(oldDetails, newDetails) {\n var delta = newDetails.startSN + newDetails.skippedSegments - oldDetails.startSN;\n var oldFragments = oldDetails.fragments;\n if (delta < 0 || delta >= oldFragments.length) {\n return;\n }\n addSliding(newDetails, oldFragments[delta].start);\n}\nfunction addSliding(details, start) {\n if (start) {\n var fragments = details.fragments;\n for (var i = details.skippedSegments; i < fragments.length; i++) {\n fragments[i].start += start;\n }\n if (details.fragmentHint) {\n details.fragmentHint.start += start;\n }\n }\n}\nfunction computeReloadInterval(newDetails, distanceToLiveEdgeMs) {\n if (distanceToLiveEdgeMs === void 0) {\n distanceToLiveEdgeMs = Infinity;\n }\n var reloadInterval = 1000 * newDetails.targetduration;\n if (newDetails.updated) {\n // Use last segment duration when shorter than target duration and near live edge\n var fragments = newDetails.fragments;\n var liveEdgeMaxTargetDurations = 4;\n if (fragments.length && reloadInterval * liveEdgeMaxTargetDurations > distanceToLiveEdgeMs) {\n var lastSegmentDuration = fragments[fragments.length - 1].duration * 1000;\n if (lastSegmentDuration < reloadInterval) {\n reloadInterval = lastSegmentDuration;\n }\n }\n } else {\n // estimate = 'miss half average';\n // follow HLS Spec, If the client reloads a Playlist file and finds that it has not\n // changed then it MUST wait for a period of one-half the target\n // duration before retrying.\n reloadInterval /= 2;\n }\n return Math.round(reloadInterval);\n}\nfunction getFragmentWithSN(level, sn, fragCurrent) {\n if (!level || !level.details) {\n return null;\n }\n var levelDetails = level.details;\n var fragment = levelDetails.fragments[sn - levelDetails.startSN];\n if (fragment) {\n return fragment;\n }\n fragment = levelDetails.fragmentHint;\n if (fragment && fragment.sn === sn) {\n return fragment;\n }\n if (sn < levelDetails.startSN && fragCurrent && fragCurrent.sn === sn) {\n return fragCurrent;\n }\n return null;\n}\nfunction getPartWith(level, sn, partIndex) {\n if (!level || !level.details) {\n return null;\n }\n var partList = level.details.partList;\n if (partList) {\n for (var i = partList.length; i--;) {\n var part = partList[i];\n if (part.index === partIndex && part.fragment.sn === sn) {\n return part;\n }\n }\n }\n return null;\n}\n\n/***/ }),\n\n/***/ \"./src/controller/stream-controller.ts\":\n/*!*********************************************!*\\\n !*** ./src/controller/stream-controller.ts ***!\n \\*********************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ StreamController)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base-stream-controller */ \"./src/controller/base-stream-controller.ts\");\n/* harmony import */ var _is_supported__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../is-supported */ \"./src/is-supported.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/buffer-helper */ \"./src/utils/buffer-helper.ts\");\n/* harmony import */ var _fragment_tracker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./fragment-tracker */ \"./src/controller/fragment-tracker.ts\");\n/* harmony import */ var _types_loader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../types/loader */ \"./src/types/loader.ts\");\n/* harmony import */ var _loader_fragment__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../loader/fragment */ \"./src/loader/fragment.ts\");\n/* harmony import */ var _demux_transmuxer_interface__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../demux/transmuxer-interface */ \"./src/demux/transmuxer-interface.ts\");\n/* harmony import */ var _types_transmuxer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../types/transmuxer */ \"./src/types/transmuxer.ts\");\n/* harmony import */ var _gap_controller__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./gap-controller */ \"./src/controller/gap-controller.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n\n\n\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n\n\n\n\n\n\n\n\n\n\nvar TICK_INTERVAL = 100; // how often to tick in ms\nvar StreamController = /*#__PURE__*/function (_BaseStreamController) {\n _inheritsLoose(StreamController, _BaseStreamController);\n function StreamController(hls, fragmentTracker, keyLoader) {\n var _this;\n _this = _BaseStreamController.call(this, hls, fragmentTracker, keyLoader, '[stream-controller]') || this;\n _this.audioCodecSwap = false;\n _this.gapController = null;\n _this.level = -1;\n _this._forceStartLoad = false;\n _this.altAudio = false;\n _this.audioOnly = false;\n _this.fragPlaying = null;\n _this.onvplaying = null;\n _this.onvseeked = null;\n _this.fragLastKbps = 0;\n _this.couldBacktrack = false;\n _this.backtrackFragment = null;\n _this.audioCodecSwitch = false;\n _this.videoBuffer = null;\n _this._registerListeners();\n return _this;\n }\n var _proto = StreamController.prototype;\n _proto._registerListeners = function _registerListeners() {\n var hls = this.hls;\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.MEDIA_ATTACHED, this.onMediaAttached, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.MEDIA_DETACHING, this.onMediaDetaching, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.MANIFEST_LOADING, this.onManifestLoading, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.MANIFEST_PARSED, this.onManifestParsed, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.LEVEL_LOADING, this.onLevelLoading, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.LEVEL_LOADED, this.onLevelLoaded, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.FRAG_LOAD_EMERGENCY_ABORTED, this.onFragLoadEmergencyAborted, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.ERROR, this.onError, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.AUDIO_TRACK_SWITCHING, this.onAudioTrackSwitching, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.AUDIO_TRACK_SWITCHED, this.onAudioTrackSwitched, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.BUFFER_CREATED, this.onBufferCreated, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.BUFFER_FLUSHED, this.onBufferFlushed, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.LEVELS_UPDATED, this.onLevelsUpdated, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_3__.Events.FRAG_BUFFERED, this.onFragBuffered, this);\n };\n _proto._unregisterListeners = function _unregisterListeners() {\n var hls = this.hls;\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.MEDIA_ATTACHED, this.onMediaAttached, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.MEDIA_DETACHING, this.onMediaDetaching, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.MANIFEST_LOADING, this.onManifestLoading, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.MANIFEST_PARSED, this.onManifestParsed, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.LEVEL_LOADED, this.onLevelLoaded, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.FRAG_LOAD_EMERGENCY_ABORTED, this.onFragLoadEmergencyAborted, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.ERROR, this.onError, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.AUDIO_TRACK_SWITCHING, this.onAudioTrackSwitching, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.AUDIO_TRACK_SWITCHED, this.onAudioTrackSwitched, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.BUFFER_CREATED, this.onBufferCreated, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.BUFFER_FLUSHED, this.onBufferFlushed, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.LEVELS_UPDATED, this.onLevelsUpdated, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_3__.Events.FRAG_BUFFERED, this.onFragBuffered, this);\n };\n _proto.onHandlerDestroying = function onHandlerDestroying() {\n this._unregisterListeners();\n this.onMediaDetaching();\n };\n _proto.startLoad = function startLoad(startPosition) {\n if (this.levels) {\n var lastCurrentTime = this.lastCurrentTime,\n hls = this.hls;\n this.stopLoad();\n this.setInterval(TICK_INTERVAL);\n this.level = -1;\n this.fragLoadError = 0;\n if (!this.startFragRequested) {\n // determine load level\n var startLevel = hls.startLevel;\n if (startLevel === -1) {\n if (hls.config.testBandwidth && this.levels.length > 1) {\n // -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level\n startLevel = 0;\n this.bitrateTest = true;\n } else {\n startLevel = hls.nextAutoLevel;\n }\n }\n // set new level to playlist loader : this will trigger start level load\n // hls.nextLoadLevel remains until it is set to a new value or until a new frag is successfully loaded\n this.level = hls.nextLoadLevel = startLevel;\n this.loadedmetadata = false;\n }\n // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime\n if (lastCurrentTime > 0 && startPosition === -1) {\n this.log(\"Override startPosition with lastCurrentTime @\" + lastCurrentTime.toFixed(3));\n startPosition = lastCurrentTime;\n }\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE;\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;\n this.tick();\n } else {\n this._forceStartLoad = true;\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.STOPPED;\n }\n };\n _proto.stopLoad = function stopLoad() {\n this._forceStartLoad = false;\n _BaseStreamController.prototype.stopLoad.call(this);\n };\n _proto.doTick = function doTick() {\n switch (this.state) {\n case _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE:\n this.doTickIdle();\n break;\n case _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.WAITING_LEVEL:\n {\n var _levels$level;\n var levels = this.levels,\n level = this.level;\n var details = levels === null || levels === void 0 ? void 0 : (_levels$level = levels[level]) === null || _levels$level === void 0 ? void 0 : _levels$level.details;\n if (details && (!details.live || this.levelLastLoaded === this.level)) {\n if (this.waitForCdnTuneIn(details)) {\n break;\n }\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE;\n break;\n }\n break;\n }\n case _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.FRAG_LOADING_WAITING_RETRY:\n {\n var _this$media;\n var now = self.performance.now();\n var retryDate = this.retryDate;\n // if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading\n if (!retryDate || now >= retryDate || (_this$media = this.media) !== null && _this$media !== void 0 && _this$media.seeking) {\n this.log('retryDate reached, switch back to IDLE state');\n this.resetStartWhenNotLoaded(this.level);\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE;\n }\n }\n break;\n default:\n break;\n }\n // check buffer\n // check/update current fragment\n this.onTickEnd();\n };\n _proto.onTickEnd = function onTickEnd() {\n _BaseStreamController.prototype.onTickEnd.call(this);\n this.checkBuffer();\n this.checkFragmentChanged();\n };\n _proto.doTickIdle = function doTickIdle() {\n var hls = this.hls,\n levelLastLoaded = this.levelLastLoaded,\n levels = this.levels,\n media = this.media;\n var config = hls.config,\n level = hls.nextLoadLevel;\n\n // if start level not parsed yet OR\n // if video not attached AND start fragment already requested OR start frag prefetch not enabled\n // exit loop, as we either need more info (level not parsed) or we need media to be attached to load new fragment\n if (levelLastLoaded === null || !media && (this.startFragRequested || !config.startFragPrefetch)) {\n return;\n }\n\n // If the \"main\" level is audio-only but we are loading an alternate track in the same group, do not load anything\n if (this.altAudio && this.audioOnly) {\n return;\n }\n if (!levels || !levels[level]) {\n return;\n }\n var levelInfo = levels[level];\n\n // if buffer length is less than maxBufLen try to load a new fragment\n\n var bufferInfo = this.getMainFwdBufferInfo();\n if (bufferInfo === null) {\n return;\n }\n var lastDetails = this.getLevelDetails();\n if (lastDetails && this._streamEnded(bufferInfo, lastDetails)) {\n var data = {};\n if (this.altAudio) {\n data.type = 'video';\n }\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.BUFFER_EOS, data);\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.ENDED;\n return;\n }\n\n // set next load level : this will trigger a playlist load if needed\n this.level = hls.nextLoadLevel = level;\n var levelDetails = levelInfo.details;\n // if level info not retrieved yet, switch state and wait for level retrieval\n // if live playlist, ensure that new playlist has been refreshed to avoid loading/try to load\n // a useless and outdated fragment (that might even introduce load error if it is already out of the live playlist)\n if (!levelDetails || this.state === _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.WAITING_LEVEL || levelDetails.live && this.levelLastLoaded !== level) {\n this.level = level;\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.WAITING_LEVEL;\n return;\n }\n var bufferLen = bufferInfo.len;\n\n // compute max Buffer Length that we could get from this load level, based on level bitrate. don't buffer more than 60 MB and more than 30s\n var maxBufLen = this.getMaxBufferLength(levelInfo.maxBitrate);\n\n // Stay idle if we are still with buffer margins\n if (bufferLen >= maxBufLen) {\n return;\n }\n if (this.backtrackFragment && this.backtrackFragment.start > bufferInfo.end) {\n this.backtrackFragment = null;\n }\n var targetBufferTime = this.backtrackFragment ? this.backtrackFragment.start : bufferInfo.end;\n var frag = this.getNextFragment(targetBufferTime, levelDetails);\n // Avoid backtracking by loading an earlier segment in streams with segments that do not start with a key frame (flagged by `couldBacktrack`)\n if (this.couldBacktrack && !this.fragPrevious && frag && frag.sn !== 'initSegment' && this.fragmentTracker.getState(frag) !== _fragment_tracker__WEBPACK_IMPORTED_MODULE_5__.FragmentState.OK) {\n var _this$backtrackFragme;\n var backtrackSn = ((_this$backtrackFragme = this.backtrackFragment) != null ? _this$backtrackFragme : frag).sn;\n var fragIdx = backtrackSn - levelDetails.startSN;\n var backtrackFrag = levelDetails.fragments[fragIdx - 1];\n if (backtrackFrag && frag.cc === backtrackFrag.cc) {\n frag = backtrackFrag;\n this.fragmentTracker.removeFragment(backtrackFrag);\n }\n } else if (this.backtrackFragment && bufferInfo.len) {\n this.backtrackFragment = null;\n }\n // Avoid loop loading by using nextLoadPosition set for backtracking\n if (frag && this.fragmentTracker.getState(frag) === _fragment_tracker__WEBPACK_IMPORTED_MODULE_5__.FragmentState.OK && this.nextLoadPosition > targetBufferTime) {\n // Cleanup the fragment tracker before trying to find the next unbuffered fragment\n var type = this.audioOnly && !this.altAudio ? _loader_fragment__WEBPACK_IMPORTED_MODULE_7__.ElementaryStreamTypes.AUDIO : _loader_fragment__WEBPACK_IMPORTED_MODULE_7__.ElementaryStreamTypes.VIDEO;\n var mediaBuffer = (type === _loader_fragment__WEBPACK_IMPORTED_MODULE_7__.ElementaryStreamTypes.VIDEO ? this.videoBuffer : this.mediaBuffer) || this.media;\n if (mediaBuffer) {\n this.afterBufferFlushed(mediaBuffer, type, _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN);\n }\n frag = this.getNextFragment(this.nextLoadPosition, levelDetails);\n }\n if (!frag) {\n return;\n }\n if (frag.initSegment && !frag.initSegment.data && !this.bitrateTest) {\n frag = frag.initSegment;\n }\n this.loadFragment(frag, levelDetails, targetBufferTime);\n };\n _proto.loadFragment = function loadFragment(frag, levelDetails, targetBufferTime) {\n var _this$media2;\n // Check if fragment is not loaded\n var fragState = this.fragmentTracker.getState(frag);\n this.fragCurrent = frag;\n if (fragState === _fragment_tracker__WEBPACK_IMPORTED_MODULE_5__.FragmentState.NOT_LOADED) {\n if (frag.sn === 'initSegment') {\n this._loadInitSegment(frag, levelDetails);\n } else if (this.bitrateTest) {\n this.log(\"Fragment \" + frag.sn + \" of level \" + frag.level + \" is being downloaded to test bitrate and will not be buffered\");\n this._loadBitrateTestFrag(frag, levelDetails);\n } else {\n this.startFragRequested = true;\n _BaseStreamController.prototype.loadFragment.call(this, frag, levelDetails, targetBufferTime);\n }\n } else if (fragState === _fragment_tracker__WEBPACK_IMPORTED_MODULE_5__.FragmentState.APPENDING) {\n // Lower the buffer size and try again\n if (this.reduceMaxBufferLength(frag.duration)) {\n this.fragmentTracker.removeFragment(frag);\n }\n } else if (((_this$media2 = this.media) === null || _this$media2 === void 0 ? void 0 : _this$media2.buffered.length) === 0) {\n // Stop gap for bad tracker / buffer flush behavior\n this.fragmentTracker.removeAllFragments();\n }\n };\n _proto.getAppendedFrag = function getAppendedFrag(position) {\n var fragOrPart = this.fragmentTracker.getAppendedFrag(position, _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN);\n if (fragOrPart && 'fragment' in fragOrPart) {\n return fragOrPart.fragment;\n }\n return fragOrPart;\n };\n _proto.getBufferedFrag = function getBufferedFrag(position) {\n return this.fragmentTracker.getBufferedFrag(position, _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN);\n };\n _proto.followingBufferedFrag = function followingBufferedFrag(frag) {\n if (frag) {\n // try to get range of next fragment (500ms after this range)\n return this.getBufferedFrag(frag.end + 0.5);\n }\n return null;\n }\n\n /*\n on immediate level switch :\n - pause playback if playing\n - cancel any pending load request\n - and trigger a buffer flush\n */;\n _proto.immediateLevelSwitch = function immediateLevelSwitch() {\n this.abortCurrentFrag();\n this.flushMainBuffer(0, Number.POSITIVE_INFINITY);\n }\n\n /**\n * try to switch ASAP without breaking video playback:\n * in order to ensure smooth but quick level switching,\n * we need to find the next flushable buffer range\n * we should take into account new segment fetch time\n */;\n _proto.nextLevelSwitch = function nextLevelSwitch() {\n var levels = this.levels,\n media = this.media;\n // ensure that media is defined and that metadata are available (to retrieve currentTime)\n if (media !== null && media !== void 0 && media.readyState) {\n var fetchdelay;\n var fragPlayingCurrent = this.getAppendedFrag(media.currentTime);\n if (fragPlayingCurrent && fragPlayingCurrent.start > 1) {\n // flush buffer preceding current fragment (flush until current fragment start offset)\n // minus 1s to avoid video freezing, that could happen if we flush keyframe of current video ...\n this.flushMainBuffer(0, fragPlayingCurrent.start - 1);\n }\n if (!media.paused && levels) {\n // add a safety delay of 1s\n var nextLevelId = this.hls.nextLoadLevel;\n var nextLevel = levels[nextLevelId];\n var fragLastKbps = this.fragLastKbps;\n if (fragLastKbps && this.fragCurrent) {\n fetchdelay = this.fragCurrent.duration * nextLevel.maxBitrate / (1000 * fragLastKbps) + 1;\n } else {\n fetchdelay = 0;\n }\n } else {\n fetchdelay = 0;\n }\n // this.log('fetchdelay:'+fetchdelay);\n // find buffer range that will be reached once new fragment will be fetched\n var bufferedFrag = this.getBufferedFrag(media.currentTime + fetchdelay);\n if (bufferedFrag) {\n // we can flush buffer range following this one without stalling playback\n var nextBufferedFrag = this.followingBufferedFrag(bufferedFrag);\n if (nextBufferedFrag) {\n // if we are here, we can also cancel any loading/demuxing in progress, as they are useless\n this.abortCurrentFrag();\n // start flush position is in next buffered frag. Leave some padding for non-independent segments and smoother playback.\n var maxStart = nextBufferedFrag.maxStartPTS ? nextBufferedFrag.maxStartPTS : nextBufferedFrag.start;\n var fragDuration = nextBufferedFrag.duration;\n var startPts = Math.max(bufferedFrag.end, maxStart + Math.min(Math.max(fragDuration - this.config.maxFragLookUpTolerance, fragDuration * 0.5), fragDuration * 0.75));\n this.flushMainBuffer(startPts, Number.POSITIVE_INFINITY);\n }\n }\n }\n };\n _proto.abortCurrentFrag = function abortCurrentFrag() {\n var fragCurrent = this.fragCurrent;\n this.fragCurrent = null;\n this.backtrackFragment = null;\n if (fragCurrent) {\n fragCurrent.abortRequests();\n }\n switch (this.state) {\n case _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.KEY_LOADING:\n case _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.FRAG_LOADING:\n case _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.FRAG_LOADING_WAITING_RETRY:\n case _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.PARSING:\n case _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.PARSED:\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE;\n break;\n }\n this.nextLoadPosition = this.getLoadPosition();\n };\n _proto.flushMainBuffer = function flushMainBuffer(startOffset, endOffset) {\n _BaseStreamController.prototype.flushMainBuffer.call(this, startOffset, endOffset, this.altAudio ? 'video' : null);\n };\n _proto.onMediaAttached = function onMediaAttached(event, data) {\n _BaseStreamController.prototype.onMediaAttached.call(this, event, data);\n var media = data.media;\n this.onvplaying = this.onMediaPlaying.bind(this);\n this.onvseeked = this.onMediaSeeked.bind(this);\n media.addEventListener('playing', this.onvplaying);\n media.addEventListener('seeked', this.onvseeked);\n this.gapController = new _gap_controller__WEBPACK_IMPORTED_MODULE_10__[\"default\"](this.config, media, this.fragmentTracker, this.hls);\n };\n _proto.onMediaDetaching = function onMediaDetaching() {\n var media = this.media;\n if (media && this.onvplaying && this.onvseeked) {\n media.removeEventListener('playing', this.onvplaying);\n media.removeEventListener('seeked', this.onvseeked);\n this.onvplaying = this.onvseeked = null;\n this.videoBuffer = null;\n }\n this.fragPlaying = null;\n if (this.gapController) {\n this.gapController.destroy();\n this.gapController = null;\n }\n _BaseStreamController.prototype.onMediaDetaching.call(this);\n };\n _proto.onMediaPlaying = function onMediaPlaying() {\n // tick to speed up FRAG_CHANGED triggering\n this.tick();\n };\n _proto.onMediaSeeked = function onMediaSeeked() {\n var media = this.media;\n var currentTime = media ? media.currentTime : null;\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(currentTime)) {\n this.log(\"Media seeked to \" + currentTime.toFixed(3));\n }\n\n // tick to speed up FRAG_CHANGED triggering\n this.tick();\n };\n _proto.onManifestLoading = function onManifestLoading() {\n // reset buffer on manifest loading\n this.log('Trigger BUFFER_RESET');\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.BUFFER_RESET, undefined);\n this.fragmentTracker.removeAllFragments();\n this.couldBacktrack = false;\n this.startPosition = this.lastCurrentTime = 0;\n this.fragPlaying = null;\n this.backtrackFragment = null;\n };\n _proto.onManifestParsed = function onManifestParsed(event, data) {\n var aac = false;\n var heaac = false;\n var codec;\n data.levels.forEach(function (level) {\n // detect if we have different kind of audio codecs used amongst playlists\n codec = level.audioCodec;\n if (codec) {\n if (codec.indexOf('mp4a.40.2') !== -1) {\n aac = true;\n }\n if (codec.indexOf('mp4a.40.5') !== -1) {\n heaac = true;\n }\n }\n });\n this.audioCodecSwitch = aac && heaac && !(0,_is_supported__WEBPACK_IMPORTED_MODULE_2__.changeTypeSupported)();\n if (this.audioCodecSwitch) {\n this.log('Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC');\n }\n this.levels = data.levels;\n this.startFragRequested = false;\n };\n _proto.onLevelLoading = function onLevelLoading(event, data) {\n var levels = this.levels;\n if (!levels || this.state !== _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE) {\n return;\n }\n var level = levels[data.level];\n if (!level.details || level.details.live && this.levelLastLoaded !== data.level || this.waitForCdnTuneIn(level.details)) {\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.WAITING_LEVEL;\n }\n };\n _proto.onLevelLoaded = function onLevelLoaded(event, data) {\n var _curLevel$details;\n var levels = this.levels;\n var newLevelId = data.level;\n var newDetails = data.details;\n var duration = newDetails.totalduration;\n if (!levels) {\n this.warn(\"Levels were reset while loading level \" + newLevelId);\n return;\n }\n this.log(\"Level \" + newLevelId + \" loaded [\" + newDetails.startSN + \",\" + newDetails.endSN + \"], cc [\" + newDetails.startCC + \", \" + newDetails.endCC + \"] duration:\" + duration);\n var fragCurrent = this.fragCurrent;\n if (fragCurrent && (this.state === _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.FRAG_LOADING || this.state === _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.FRAG_LOADING_WAITING_RETRY)) {\n if (fragCurrent.level !== data.level && fragCurrent.loader) {\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE;\n this.backtrackFragment = null;\n fragCurrent.abortRequests();\n }\n }\n var curLevel = levels[newLevelId];\n var sliding = 0;\n if (newDetails.live || (_curLevel$details = curLevel.details) !== null && _curLevel$details !== void 0 && _curLevel$details.live) {\n if (!newDetails.fragments[0]) {\n newDetails.deltaUpdateFailed = true;\n }\n if (newDetails.deltaUpdateFailed) {\n return;\n }\n sliding = this.alignPlaylists(newDetails, curLevel.details);\n }\n // override level info\n curLevel.details = newDetails;\n this.levelLastLoaded = newLevelId;\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.LEVEL_UPDATED, {\n details: newDetails,\n level: newLevelId\n });\n\n // only switch back to IDLE state if we were waiting for level to start downloading a new fragment\n if (this.state === _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.WAITING_LEVEL) {\n if (this.waitForCdnTuneIn(newDetails)) {\n // Wait for Low-Latency CDN Tune-in\n return;\n }\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE;\n }\n if (!this.startFragRequested) {\n this.setStartPosition(newDetails, sliding);\n } else if (newDetails.live) {\n this.synchronizeToLiveEdge(newDetails);\n }\n\n // trigger handler right now\n this.tick();\n };\n _proto._handleFragmentLoadProgress = function _handleFragmentLoadProgress(data) {\n var _frag$initSegment;\n var frag = data.frag,\n part = data.part,\n payload = data.payload;\n var levels = this.levels;\n if (!levels) {\n this.warn(\"Levels were reset while fragment load was in progress. Fragment \" + frag.sn + \" of level \" + frag.level + \" will not be buffered\");\n return;\n }\n var currentLevel = levels[frag.level];\n var details = currentLevel.details;\n if (!details) {\n this.warn(\"Dropping fragment \" + frag.sn + \" of level \" + frag.level + \" after level details were reset\");\n return;\n }\n var videoCodec = currentLevel.videoCodec;\n\n // time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)\n var accurateTimeOffset = details.PTSKnown || !details.live;\n var initSegmentData = (_frag$initSegment = frag.initSegment) === null || _frag$initSegment === void 0 ? void 0 : _frag$initSegment.data;\n var audioCodec = this._getAudioCodec(currentLevel);\n\n // transmux the MPEG-TS data to ISO-BMFF segments\n // this.log(`Transmuxing ${frag.sn} of [${details.startSN} ,${details.endSN}],level ${frag.level}, cc ${frag.cc}`);\n var transmuxer = this.transmuxer = this.transmuxer || new _demux_transmuxer_interface__WEBPACK_IMPORTED_MODULE_8__[\"default\"](this.hls, _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN, this._handleTransmuxComplete.bind(this), this._handleTransmuxerFlush.bind(this));\n var partIndex = part ? part.index : -1;\n var partial = partIndex !== -1;\n var chunkMeta = new _types_transmuxer__WEBPACK_IMPORTED_MODULE_9__.ChunkMetadata(frag.level, frag.sn, frag.stats.chunkCount, payload.byteLength, partIndex, partial);\n var initPTS = this.initPTS[frag.cc];\n transmuxer.push(payload, initSegmentData, audioCodec, videoCodec, frag, part, details.totalduration, accurateTimeOffset, chunkMeta, initPTS);\n };\n _proto.onAudioTrackSwitching = function onAudioTrackSwitching(event, data) {\n // if any URL found on new audio track, it is an alternate audio track\n var fromAltAudio = this.altAudio;\n var altAudio = !!data.url;\n var trackId = data.id;\n // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n // don't do anything if we switch to alt audio: audio stream controller is handling it.\n // we will just have to change buffer scheduling on audioTrackSwitched\n if (!altAudio) {\n if (this.mediaBuffer !== this.media) {\n this.log('Switching on main audio, use media.buffered to schedule main fragment loading');\n this.mediaBuffer = this.media;\n var fragCurrent = this.fragCurrent;\n // we need to refill audio buffer from main: cancel any frag loading to speed up audio switch\n if (fragCurrent) {\n this.log('Switching to main audio track, cancel main fragment load');\n fragCurrent.abortRequests();\n }\n // destroy transmuxer to force init segment generation (following audio switch)\n this.resetTransmuxer();\n // switch to IDLE state to load new fragment\n this.resetLoadingState();\n } else if (this.audioOnly) {\n // Reset audio transmuxer so when switching back to main audio we're not still appending where we left off\n this.resetTransmuxer();\n }\n var hls = this.hls;\n // If switching from alt to main audio, flush all audio and trigger track switched\n if (fromAltAudio) {\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.BUFFER_FLUSHING, {\n startOffset: 0,\n endOffset: Number.POSITIVE_INFINITY,\n type: 'audio'\n });\n }\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.AUDIO_TRACK_SWITCHED, {\n id: trackId\n });\n }\n };\n _proto.onAudioTrackSwitched = function onAudioTrackSwitched(event, data) {\n var trackId = data.id;\n var altAudio = !!this.hls.audioTracks[trackId].url;\n if (altAudio) {\n var videoBuffer = this.videoBuffer;\n // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n if (videoBuffer && this.mediaBuffer !== videoBuffer) {\n this.log('Switching on alternate audio, use video.buffered to schedule main fragment loading');\n this.mediaBuffer = videoBuffer;\n }\n }\n this.altAudio = altAudio;\n this.tick();\n };\n _proto.onBufferCreated = function onBufferCreated(event, data) {\n var tracks = data.tracks;\n var mediaTrack;\n var name;\n var alternate = false;\n for (var type in tracks) {\n var track = tracks[type];\n if (track.id === 'main') {\n name = type;\n mediaTrack = track;\n // keep video source buffer reference\n if (type === 'video') {\n var videoTrack = tracks[type];\n if (videoTrack) {\n this.videoBuffer = videoTrack.buffer;\n }\n }\n } else {\n alternate = true;\n }\n }\n if (alternate && mediaTrack) {\n this.log(\"Alternate track found, use \" + name + \".buffered to schedule main fragment loading\");\n this.mediaBuffer = mediaTrack.buffer;\n } else {\n this.mediaBuffer = this.media;\n }\n };\n _proto.onFragBuffered = function onFragBuffered(event, data) {\n var frag = data.frag,\n part = data.part;\n if (frag && frag.type !== _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN) {\n return;\n }\n if (this.fragContextChanged(frag)) {\n // If a level switch was requested while a fragment was buffering, it will emit the FRAG_BUFFERED event upon completion\n // Avoid setting state back to IDLE, since that will interfere with a level switch\n this.warn(\"Fragment \" + frag.sn + (part ? ' p: ' + part.index : '') + \" of level \" + frag.level + \" finished buffering, but was aborted. state: \" + this.state);\n if (this.state === _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.PARSED) {\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE;\n }\n return;\n }\n var stats = part ? part.stats : frag.stats;\n this.fragLastKbps = Math.round(8 * stats.total / (stats.buffering.end - stats.loading.first));\n if (frag.sn !== 'initSegment') {\n this.fragPrevious = frag;\n }\n this.fragBufferedComplete(frag, part);\n };\n _proto.onError = function onError(event, data) {\n if (data.type === _errors__WEBPACK_IMPORTED_MODULE_11__.ErrorTypes.KEY_SYSTEM_ERROR) {\n this.onFragmentOrKeyLoadError(_types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN, data);\n return;\n }\n switch (data.details) {\n case _errors__WEBPACK_IMPORTED_MODULE_11__.ErrorDetails.FRAG_LOAD_ERROR:\n case _errors__WEBPACK_IMPORTED_MODULE_11__.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _errors__WEBPACK_IMPORTED_MODULE_11__.ErrorDetails.FRAG_PARSING_ERROR:\n case _errors__WEBPACK_IMPORTED_MODULE_11__.ErrorDetails.KEY_LOAD_ERROR:\n case _errors__WEBPACK_IMPORTED_MODULE_11__.ErrorDetails.KEY_LOAD_TIMEOUT:\n this.onFragmentOrKeyLoadError(_types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN, data);\n break;\n case _errors__WEBPACK_IMPORTED_MODULE_11__.ErrorDetails.LEVEL_LOAD_ERROR:\n case _errors__WEBPACK_IMPORTED_MODULE_11__.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n if (this.state !== _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.ERROR) {\n if (data.fatal) {\n // if fatal error, stop processing\n this.warn(\"\" + data.details);\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.ERROR;\n } else {\n // in case of non fatal error while loading level, if level controller is not retrying to load level , switch back to IDLE\n if (!data.levelRetry && this.state === _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.WAITING_LEVEL) {\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE;\n }\n }\n }\n break;\n case _errors__WEBPACK_IMPORTED_MODULE_11__.ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'main' && (this.state === _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.PARSING || this.state === _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.PARSED)) {\n var flushBuffer = true;\n var bufferedInfo = this.getFwdBufferInfo(this.media, _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN);\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n // reduce max buf len if current position is buffered\n if (bufferedInfo && bufferedInfo.len > 0.5) {\n flushBuffer = !this.reduceMaxBufferLength(bufferedInfo.len);\n }\n if (flushBuffer) {\n // current position is not buffered, but browser is still complaining about buffer full error\n // this happens on IE/Edge, refer to https://github.com/video-dev/hls.js/pull/708\n // in that case flush the whole buffer to recover\n this.warn('buffer full error also media.currentTime is not buffered, flush main');\n // flush main buffer\n this.immediateLevelSwitch();\n }\n this.resetLoadingState();\n }\n break;\n default:\n break;\n }\n }\n\n // Checks the health of the buffer and attempts to resolve playback stalls.\n ;\n _proto.checkBuffer = function checkBuffer() {\n var media = this.media,\n gapController = this.gapController;\n if (!media || !gapController || !media.readyState) {\n // Exit early if we don't have media or if the media hasn't buffered anything yet (readyState 0)\n return;\n }\n if (this.loadedmetadata || !_utils_buffer_helper__WEBPACK_IMPORTED_MODULE_4__.BufferHelper.getBuffered(media).length) {\n // Resolve gaps using the main buffer, whose ranges are the intersections of the A/V sourcebuffers\n var activeFrag = this.state !== _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE ? this.fragCurrent : null;\n gapController.poll(this.lastCurrentTime, activeFrag);\n }\n this.lastCurrentTime = media.currentTime;\n };\n _proto.onFragLoadEmergencyAborted = function onFragLoadEmergencyAborted() {\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE;\n // if loadedmetadata is not set, it means that we are emergency switch down on first frag\n // in that case, reset startFragRequested flag\n if (!this.loadedmetadata) {\n this.startFragRequested = false;\n this.nextLoadPosition = this.startPosition;\n }\n this.tickImmediate();\n };\n _proto.onBufferFlushed = function onBufferFlushed(event, _ref) {\n var type = _ref.type;\n if (type !== _loader_fragment__WEBPACK_IMPORTED_MODULE_7__.ElementaryStreamTypes.AUDIO || this.audioOnly && !this.altAudio) {\n var mediaBuffer = (type === _loader_fragment__WEBPACK_IMPORTED_MODULE_7__.ElementaryStreamTypes.VIDEO ? this.videoBuffer : this.mediaBuffer) || this.media;\n this.afterBufferFlushed(mediaBuffer, type, _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN);\n }\n };\n _proto.onLevelsUpdated = function onLevelsUpdated(event, data) {\n this.levels = data.levels;\n };\n _proto.swapAudioCodec = function swapAudioCodec() {\n this.audioCodecSwap = !this.audioCodecSwap;\n }\n\n /**\n * Seeks to the set startPosition if not equal to the mediaElement's current time.\n */;\n _proto.seekToStartPos = function seekToStartPos() {\n var media = this.media;\n if (!media) {\n return;\n }\n var currentTime = media.currentTime;\n var startPosition = this.startPosition;\n // only adjust currentTime if different from startPosition or if startPosition not buffered\n // at that stage, there should be only one buffered range, as we reach that code after first fragment has been buffered\n if (startPosition >= 0 && currentTime < startPosition) {\n if (media.seeking) {\n this.log(\"could not seek to \" + startPosition + \", already seeking at \" + currentTime);\n return;\n }\n var buffered = _utils_buffer_helper__WEBPACK_IMPORTED_MODULE_4__.BufferHelper.getBuffered(media);\n var bufferStart = buffered.length ? buffered.start(0) : 0;\n var delta = bufferStart - startPosition;\n if (delta > 0 && (delta < this.config.maxBufferHole || delta < this.config.maxFragLookUpTolerance)) {\n this.log(\"adjusting start position by \" + delta + \" to match buffer start\");\n startPosition += delta;\n this.startPosition = startPosition;\n }\n this.log(\"seek to target start position \" + startPosition + \" from current time \" + currentTime);\n media.currentTime = startPosition;\n }\n };\n _proto._getAudioCodec = function _getAudioCodec(currentLevel) {\n var audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;\n if (this.audioCodecSwap && audioCodec) {\n this.log('Swapping audio codec');\n if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n audioCodec = 'mp4a.40.2';\n } else {\n audioCodec = 'mp4a.40.5';\n }\n }\n return audioCodec;\n };\n _proto._loadBitrateTestFrag = function _loadBitrateTestFrag(frag, levelDetails) {\n var _this2 = this;\n frag.bitrateTest = true;\n this._doFragLoad(frag, levelDetails).then(function (data) {\n var hls = _this2.hls;\n if (!data || _this2.fragContextChanged(frag)) {\n return;\n }\n _this2.fragLoadError = 0;\n _this2.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE;\n _this2.startFragRequested = false;\n _this2.bitrateTest = false;\n var stats = frag.stats;\n // Bitrate tests fragments are neither parsed nor buffered\n stats.parsing.start = stats.parsing.end = stats.buffering.start = stats.buffering.end = self.performance.now();\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.FRAG_LOADED, data);\n frag.bitrateTest = false;\n });\n };\n _proto._handleTransmuxComplete = function _handleTransmuxComplete(transmuxResult) {\n var _id3$samples;\n var id = 'main';\n var hls = this.hls;\n var remuxResult = transmuxResult.remuxResult,\n chunkMeta = transmuxResult.chunkMeta;\n var context = this.getCurrentContext(chunkMeta);\n if (!context) {\n this.warn(\"The loading context changed while buffering fragment \" + chunkMeta.sn + \" of level \" + chunkMeta.level + \". This chunk will not be buffered.\");\n this.resetStartWhenNotLoaded(chunkMeta.level);\n return;\n }\n var frag = context.frag,\n part = context.part,\n level = context.level;\n var video = remuxResult.video,\n text = remuxResult.text,\n id3 = remuxResult.id3,\n initSegment = remuxResult.initSegment;\n var details = level.details;\n // The audio-stream-controller handles audio buffering if Hls.js is playing an alternate audio track\n var audio = this.altAudio ? undefined : remuxResult.audio;\n\n // Check if the current fragment has been aborted. We check this by first seeing if we're still playing the current level.\n // If we are, subsequently check if the currently loading fragment (fragCurrent) has changed.\n if (this.fragContextChanged(frag)) {\n return;\n }\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.PARSING;\n if (initSegment) {\n if (initSegment.tracks) {\n this._bufferInitSegment(level, initSegment.tracks, frag, chunkMeta);\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.FRAG_PARSING_INIT_SEGMENT, {\n frag: frag,\n id: id,\n tracks: initSegment.tracks\n });\n }\n\n // This would be nice if Number.isFinite acted as a typeguard, but it doesn't. See: https://github.com/Microsoft/TypeScript/issues/10038\n var initPTS = initSegment.initPTS;\n var timescale = initSegment.timescale;\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(initPTS)) {\n this.initPTS[frag.cc] = initPTS;\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.INIT_PTS_FOUND, {\n frag: frag,\n id: id,\n initPTS: initPTS,\n timescale: timescale\n });\n }\n }\n\n // Avoid buffering if backtracking this fragment\n if (video && remuxResult.independent !== false) {\n if (details) {\n var startPTS = video.startPTS,\n endPTS = video.endPTS,\n startDTS = video.startDTS,\n endDTS = video.endDTS;\n if (part) {\n part.elementaryStreams[video.type] = {\n startPTS: startPTS,\n endPTS: endPTS,\n startDTS: startDTS,\n endDTS: endDTS\n };\n } else {\n if (video.firstKeyFrame && video.independent && chunkMeta.id === 1) {\n this.couldBacktrack = true;\n }\n if (video.dropped && video.independent) {\n // Backtrack if dropped frames create a gap after currentTime\n\n var bufferInfo = this.getMainFwdBufferInfo();\n var targetBufferTime = (bufferInfo ? bufferInfo.end : this.getLoadPosition()) + this.config.maxBufferHole;\n var startTime = video.firstKeyFramePTS ? video.firstKeyFramePTS : startPTS;\n if (targetBufferTime < startTime - this.config.maxBufferHole) {\n this.backtrack(frag);\n return;\n }\n // Set video stream start to fragment start so that truncated samples do not distort the timeline, and mark it partial\n frag.setElementaryStreamInfo(video.type, frag.start, endPTS, frag.start, endDTS, true);\n }\n }\n frag.setElementaryStreamInfo(video.type, startPTS, endPTS, startDTS, endDTS);\n if (this.backtrackFragment) {\n this.backtrackFragment = frag;\n }\n this.bufferFragmentData(video, frag, part, chunkMeta);\n }\n } else if (remuxResult.independent === false) {\n this.backtrack(frag);\n return;\n }\n if (audio) {\n var _startPTS = audio.startPTS,\n _endPTS = audio.endPTS,\n _startDTS = audio.startDTS,\n _endDTS = audio.endDTS;\n if (part) {\n part.elementaryStreams[_loader_fragment__WEBPACK_IMPORTED_MODULE_7__.ElementaryStreamTypes.AUDIO] = {\n startPTS: _startPTS,\n endPTS: _endPTS,\n startDTS: _startDTS,\n endDTS: _endDTS\n };\n }\n frag.setElementaryStreamInfo(_loader_fragment__WEBPACK_IMPORTED_MODULE_7__.ElementaryStreamTypes.AUDIO, _startPTS, _endPTS, _startDTS, _endDTS);\n this.bufferFragmentData(audio, frag, part, chunkMeta);\n }\n if (details && id3 !== null && id3 !== void 0 && (_id3$samples = id3.samples) !== null && _id3$samples !== void 0 && _id3$samples.length) {\n var emittedID3 = {\n id: id,\n frag: frag,\n details: details,\n samples: id3.samples\n };\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.FRAG_PARSING_METADATA, emittedID3);\n }\n if (details && text) {\n var emittedText = {\n id: id,\n frag: frag,\n details: details,\n samples: text.samples\n };\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.FRAG_PARSING_USERDATA, emittedText);\n }\n };\n _proto._bufferInitSegment = function _bufferInitSegment(currentLevel, tracks, frag, chunkMeta) {\n var _this3 = this;\n if (this.state !== _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.PARSING) {\n return;\n }\n this.audioOnly = !!tracks.audio && !tracks.video;\n\n // if audio track is expected to come from audio stream controller, discard any coming from main\n if (this.altAudio && !this.audioOnly) {\n delete tracks.audio;\n }\n // include levelCodec in audio and video tracks\n var audio = tracks.audio,\n video = tracks.video,\n audiovideo = tracks.audiovideo;\n if (audio) {\n var audioCodec = currentLevel.audioCodec;\n var ua = navigator.userAgent.toLowerCase();\n if (this.audioCodecSwitch) {\n if (audioCodec) {\n if (audioCodec.indexOf('mp4a.40.5') !== -1) {\n audioCodec = 'mp4a.40.2';\n } else {\n audioCodec = 'mp4a.40.5';\n }\n }\n // In the case that AAC and HE-AAC audio codecs are signalled in manifest,\n // force HE-AAC, as it seems that most browsers prefers it.\n // don't force HE-AAC if mono stream, or in Firefox\n if (audio.metadata.channelCount !== 1 && ua.indexOf('firefox') === -1) {\n audioCodec = 'mp4a.40.5';\n }\n }\n // HE-AAC is broken on Android, always signal audio codec as AAC even if variant manifest states otherwise\n if (ua.indexOf('android') !== -1 && audio.container !== 'audio/mpeg') {\n // Exclude mpeg audio\n audioCodec = 'mp4a.40.2';\n this.log(\"Android: force audio codec to \" + audioCodec);\n }\n if (currentLevel.audioCodec && currentLevel.audioCodec !== audioCodec) {\n this.log(\"Swapping manifest audio codec \\\"\" + currentLevel.audioCodec + \"\\\" for \\\"\" + audioCodec + \"\\\"\");\n }\n audio.levelCodec = audioCodec;\n audio.id = 'main';\n this.log(\"Init audio buffer, container:\" + audio.container + \", codecs[selected/level/parsed]=[\" + (audioCodec || '') + \"/\" + (currentLevel.audioCodec || '') + \"/\" + audio.codec + \"]\");\n }\n if (video) {\n video.levelCodec = currentLevel.videoCodec;\n video.id = 'main';\n this.log(\"Init video buffer, container:\" + video.container + \", codecs[level/parsed]=[\" + (currentLevel.videoCodec || '') + \"/\" + video.codec + \"]\");\n }\n if (audiovideo) {\n this.log(\"Init audiovideo buffer, container:\" + audiovideo.container + \", codecs[level/parsed]=[\" + (currentLevel.attrs.CODECS || '') + \"/\" + audiovideo.codec + \"]\");\n }\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.BUFFER_CODECS, tracks);\n // loop through tracks that are going to be provided to bufferController\n Object.keys(tracks).forEach(function (trackName) {\n var track = tracks[trackName];\n var initSegment = track.initSegment;\n if (initSegment !== null && initSegment !== void 0 && initSegment.byteLength) {\n _this3.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.BUFFER_APPENDING, {\n type: trackName,\n data: initSegment,\n frag: frag,\n part: null,\n chunkMeta: chunkMeta,\n parent: frag.type\n });\n }\n });\n // trigger handler right now\n this.tick();\n };\n _proto.getMainFwdBufferInfo = function getMainFwdBufferInfo() {\n return this.getFwdBufferInfo(this.mediaBuffer ? this.mediaBuffer : this.media, _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.MAIN);\n };\n _proto.backtrack = function backtrack(frag) {\n this.couldBacktrack = true;\n // Causes findFragments to backtrack through fragments to find the keyframe\n this.backtrackFragment = frag;\n this.resetTransmuxer();\n this.flushBufferGap(frag);\n this.fragmentTracker.removeFragment(frag);\n this.fragPrevious = null;\n this.nextLoadPosition = frag.start;\n this.state = _base_stream_controller__WEBPACK_IMPORTED_MODULE_1__.State.IDLE;\n };\n _proto.checkFragmentChanged = function checkFragmentChanged() {\n var video = this.media;\n var fragPlayingCurrent = null;\n if (video && video.readyState > 1 && video.seeking === false) {\n var currentTime = video.currentTime;\n /* if video element is in seeked state, currentTime can only increase.\n (assuming that playback rate is positive ...)\n As sometimes currentTime jumps back to zero after a\n media decode error, check this, to avoid seeking back to\n wrong position after a media decode error\n */\n\n if (_utils_buffer_helper__WEBPACK_IMPORTED_MODULE_4__.BufferHelper.isBuffered(video, currentTime)) {\n fragPlayingCurrent = this.getAppendedFrag(currentTime);\n } else if (_utils_buffer_helper__WEBPACK_IMPORTED_MODULE_4__.BufferHelper.isBuffered(video, currentTime + 0.1)) {\n /* ensure that FRAG_CHANGED event is triggered at startup,\n when first video frame is displayed and playback is paused.\n add a tolerance of 100ms, in case current position is not buffered,\n check if current pos+100ms is buffered and use that buffer range\n for FRAG_CHANGED event reporting */\n fragPlayingCurrent = this.getAppendedFrag(currentTime + 0.1);\n }\n if (fragPlayingCurrent) {\n this.backtrackFragment = null;\n var fragPlaying = this.fragPlaying;\n var fragCurrentLevel = fragPlayingCurrent.level;\n if (!fragPlaying || fragPlayingCurrent.sn !== fragPlaying.sn || fragPlaying.level !== fragCurrentLevel || fragPlayingCurrent.urlId !== fragPlaying.urlId) {\n this.fragPlaying = fragPlayingCurrent;\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.FRAG_CHANGED, {\n frag: fragPlayingCurrent\n });\n if (!fragPlaying || fragPlaying.level !== fragCurrentLevel) {\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_3__.Events.LEVEL_SWITCHED, {\n level: fragCurrentLevel\n });\n }\n }\n }\n }\n };\n _createClass(StreamController, [{\n key: \"nextLevel\",\n get: function get() {\n var frag = this.nextBufferedFrag;\n if (frag) {\n return frag.level;\n }\n return -1;\n }\n }, {\n key: \"currentFrag\",\n get: function get() {\n var media = this.media;\n if (media) {\n return this.fragPlaying || this.getAppendedFrag(media.currentTime);\n }\n return null;\n }\n }, {\n key: \"currentProgramDateTime\",\n get: function get() {\n var media = this.media;\n if (media) {\n var currentTime = media.currentTime;\n var frag = this.currentFrag;\n if (frag && (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(currentTime) && (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(frag.programDateTime)) {\n var epocMs = frag.programDateTime + (currentTime - frag.start) * 1000;\n return new Date(epocMs);\n }\n }\n return null;\n }\n }, {\n key: \"currentLevel\",\n get: function get() {\n var frag = this.currentFrag;\n if (frag) {\n return frag.level;\n }\n return -1;\n }\n }, {\n key: \"nextBufferedFrag\",\n get: function get() {\n var frag = this.currentFrag;\n if (frag) {\n return this.followingBufferedFrag(frag);\n }\n return null;\n }\n }, {\n key: \"forceStartLoad\",\n get: function get() {\n return this._forceStartLoad;\n }\n }]);\n return StreamController;\n}(_base_stream_controller__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n\n/***/ }),\n\n/***/ \"./src/crypt/aes-crypto.ts\":\n/*!*********************************!*\\\n !*** ./src/crypt/aes-crypto.ts ***!\n \\*********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AESCrypto)\n/* harmony export */ });\nvar AESCrypto = /*#__PURE__*/function () {\n function AESCrypto(subtle, iv) {\n this.subtle = void 0;\n this.aesIV = void 0;\n this.subtle = subtle;\n this.aesIV = iv;\n }\n var _proto = AESCrypto.prototype;\n _proto.decrypt = function decrypt(data, key) {\n return this.subtle.decrypt({\n name: 'AES-CBC',\n iv: this.aesIV\n }, key, data);\n };\n return AESCrypto;\n}();\n\n\n/***/ }),\n\n/***/ \"./src/crypt/aes-decryptor.ts\":\n/*!************************************!*\\\n !*** ./src/crypt/aes-decryptor.ts ***!\n \\************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AESDecryptor),\n/* harmony export */ \"removePadding\": () => (/* binding */ removePadding)\n/* harmony export */ });\n/* harmony import */ var _utils_typed_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/typed-array */ \"./src/utils/typed-array.ts\");\n\n\n// PKCS7\nfunction removePadding(array) {\n var outputBytes = array.byteLength;\n var paddingBytes = outputBytes && new DataView(array.buffer).getUint8(outputBytes - 1);\n if (paddingBytes) {\n return (0,_utils_typed_array__WEBPACK_IMPORTED_MODULE_0__.sliceUint8)(array, 0, outputBytes - paddingBytes);\n }\n return array;\n}\nvar AESDecryptor = /*#__PURE__*/function () {\n function AESDecryptor() {\n this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n this.subMix = [new Uint32Array(256), new Uint32Array(256), new Uint32Array(256), new Uint32Array(256)];\n this.invSubMix = [new Uint32Array(256), new Uint32Array(256), new Uint32Array(256), new Uint32Array(256)];\n this.sBox = new Uint32Array(256);\n this.invSBox = new Uint32Array(256);\n this.key = new Uint32Array(0);\n this.ksRows = 0;\n this.keySize = 0;\n this.keySchedule = void 0;\n this.invKeySchedule = void 0;\n this.initTable();\n }\n\n // Using view.getUint32() also swaps the byte order.\n var _proto = AESDecryptor.prototype;\n _proto.uint8ArrayToUint32Array_ = function uint8ArrayToUint32Array_(arrayBuffer) {\n var view = new DataView(arrayBuffer);\n var newArray = new Uint32Array(4);\n for (var i = 0; i < 4; i++) {\n newArray[i] = view.getUint32(i * 4);\n }\n return newArray;\n };\n _proto.initTable = function initTable() {\n var sBox = this.sBox;\n var invSBox = this.invSBox;\n var subMix = this.subMix;\n var subMix0 = subMix[0];\n var subMix1 = subMix[1];\n var subMix2 = subMix[2];\n var subMix3 = subMix[3];\n var invSubMix = this.invSubMix;\n var invSubMix0 = invSubMix[0];\n var invSubMix1 = invSubMix[1];\n var invSubMix2 = invSubMix[2];\n var invSubMix3 = invSubMix[3];\n var d = new Uint32Array(256);\n var x = 0;\n var xi = 0;\n var i = 0;\n for (i = 0; i < 256; i++) {\n if (i < 128) {\n d[i] = i << 1;\n } else {\n d[i] = i << 1 ^ 0x11b;\n }\n }\n for (i = 0; i < 256; i++) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 0xff ^ 0x63;\n sBox[x] = sx;\n invSBox[sx] = x;\n\n // Compute multiplication\n var x2 = d[x];\n var x4 = d[x2];\n var x8 = d[x4];\n\n // Compute sub/invSub bytes, mix columns tables\n var t = d[sx] * 0x101 ^ sx * 0x1010100;\n subMix0[x] = t << 24 | t >>> 8;\n subMix1[x] = t << 16 | t >>> 16;\n subMix2[x] = t << 8 | t >>> 24;\n subMix3[x] = t;\n\n // Compute inv sub bytes, inv mix columns tables\n t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n invSubMix0[sx] = t << 24 | t >>> 8;\n invSubMix1[sx] = t << 16 | t >>> 16;\n invSubMix2[sx] = t << 8 | t >>> 24;\n invSubMix3[sx] = t;\n\n // Compute next counter\n if (!x) {\n x = xi = 1;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n }\n };\n _proto.expandKey = function expandKey(keyBuffer) {\n // convert keyBuffer to Uint32Array\n var key = this.uint8ArrayToUint32Array_(keyBuffer);\n var sameKey = true;\n var offset = 0;\n while (offset < key.length && sameKey) {\n sameKey = key[offset] === this.key[offset];\n offset++;\n }\n if (sameKey) {\n return;\n }\n this.key = key;\n var keySize = this.keySize = key.length;\n if (keySize !== 4 && keySize !== 6 && keySize !== 8) {\n throw new Error('Invalid aes key size=' + keySize);\n }\n var ksRows = this.ksRows = (keySize + 6 + 1) * 4;\n var ksRow;\n var invKsRow;\n var keySchedule = this.keySchedule = new Uint32Array(ksRows);\n var invKeySchedule = this.invKeySchedule = new Uint32Array(ksRows);\n var sbox = this.sBox;\n var rcon = this.rcon;\n var invSubMix = this.invSubMix;\n var invSubMix0 = invSubMix[0];\n var invSubMix1 = invSubMix[1];\n var invSubMix2 = invSubMix[2];\n var invSubMix3 = invSubMix[3];\n var prev;\n var t;\n for (ksRow = 0; ksRow < ksRows; ksRow++) {\n if (ksRow < keySize) {\n prev = keySchedule[ksRow] = key[ksRow];\n continue;\n }\n t = prev;\n if (ksRow % keySize === 0) {\n // Rot word\n t = t << 8 | t >>> 24;\n\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n\n // Mix Rcon\n t ^= rcon[ksRow / keySize | 0] << 24;\n } else if (keySize > 6 && ksRow % keySize === 4) {\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n }\n keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;\n }\n for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n ksRow = ksRows - invKsRow;\n if (invKsRow & 3) {\n t = keySchedule[ksRow];\n } else {\n t = keySchedule[ksRow - 4];\n }\n if (invKsRow < 4 || ksRow <= 4) {\n invKeySchedule[invKsRow] = t;\n } else {\n invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[t >>> 16 & 0xff]] ^ invSubMix2[sbox[t >>> 8 & 0xff]] ^ invSubMix3[sbox[t & 0xff]];\n }\n invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;\n }\n }\n\n // Adding this as a method greatly improves performance.\n ;\n _proto.networkToHostOrderSwap = function networkToHostOrderSwap(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n };\n _proto.decrypt = function decrypt(inputArrayBuffer, offset, aesIV) {\n var nRounds = this.keySize + 6;\n var invKeySchedule = this.invKeySchedule;\n var invSBOX = this.invSBox;\n var invSubMix = this.invSubMix;\n var invSubMix0 = invSubMix[0];\n var invSubMix1 = invSubMix[1];\n var invSubMix2 = invSubMix[2];\n var invSubMix3 = invSubMix[3];\n var initVector = this.uint8ArrayToUint32Array_(aesIV);\n var initVector0 = initVector[0];\n var initVector1 = initVector[1];\n var initVector2 = initVector[2];\n var initVector3 = initVector[3];\n var inputInt32 = new Int32Array(inputArrayBuffer);\n var outputInt32 = new Int32Array(inputInt32.length);\n var t0, t1, t2, t3;\n var s0, s1, s2, s3;\n var inputWords0, inputWords1, inputWords2, inputWords3;\n var ksRow, i;\n var swapWord = this.networkToHostOrderSwap;\n while (offset < inputInt32.length) {\n inputWords0 = swapWord(inputInt32[offset]);\n inputWords1 = swapWord(inputInt32[offset + 1]);\n inputWords2 = swapWord(inputInt32[offset + 2]);\n inputWords3 = swapWord(inputInt32[offset + 3]);\n s0 = inputWords0 ^ invKeySchedule[0];\n s1 = inputWords3 ^ invKeySchedule[1];\n s2 = inputWords2 ^ invKeySchedule[2];\n s3 = inputWords1 ^ invKeySchedule[3];\n ksRow = 4;\n\n // Iterate through the rounds of decryption\n for (i = 1; i < nRounds; i++) {\n t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[s1 >> 16 & 0xff] ^ invSubMix2[s2 >> 8 & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[s2 >> 16 & 0xff] ^ invSubMix2[s3 >> 8 & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[s3 >> 16 & 0xff] ^ invSubMix2[s0 >> 8 & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[s0 >> 16 & 0xff] ^ invSubMix2[s1 >> 8 & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n // Update state\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n ksRow = ksRow + 4;\n }\n\n // Shift rows, sub bytes, add round key\n t0 = invSBOX[s0 >>> 24] << 24 ^ invSBOX[s1 >> 16 & 0xff] << 16 ^ invSBOX[s2 >> 8 & 0xff] << 8 ^ invSBOX[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSBOX[s1 >>> 24] << 24 ^ invSBOX[s2 >> 16 & 0xff] << 16 ^ invSBOX[s3 >> 8 & 0xff] << 8 ^ invSBOX[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSBOX[s2 >>> 24] << 24 ^ invSBOX[s3 >> 16 & 0xff] << 16 ^ invSBOX[s0 >> 8 & 0xff] << 8 ^ invSBOX[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSBOX[s3 >>> 24] << 24 ^ invSBOX[s0 >> 16 & 0xff] << 16 ^ invSBOX[s1 >> 8 & 0xff] << 8 ^ invSBOX[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n\n // Write\n outputInt32[offset] = swapWord(t0 ^ initVector0);\n outputInt32[offset + 1] = swapWord(t3 ^ initVector1);\n outputInt32[offset + 2] = swapWord(t2 ^ initVector2);\n outputInt32[offset + 3] = swapWord(t1 ^ initVector3);\n\n // reset initVector to last 4 unsigned int\n initVector0 = inputWords0;\n initVector1 = inputWords1;\n initVector2 = inputWords2;\n initVector3 = inputWords3;\n offset = offset + 4;\n }\n return outputInt32.buffer;\n };\n return AESDecryptor;\n}();\n\n\n/***/ }),\n\n/***/ \"./src/crypt/decrypter.ts\":\n/*!********************************!*\\\n !*** ./src/crypt/decrypter.ts ***!\n \\********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Decrypter)\n/* harmony export */ });\n/* harmony import */ var _aes_crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./aes-crypto */ \"./src/crypt/aes-crypto.ts\");\n/* harmony import */ var _fast_aes_key__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fast-aes-key */ \"./src/crypt/fast-aes-key.ts\");\n/* harmony import */ var _aes_decryptor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./aes-decryptor */ \"./src/crypt/aes-decryptor.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _utils_mp4_tools__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/mp4-tools */ \"./src/utils/mp4-tools.ts\");\n/* harmony import */ var _utils_typed_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/typed-array */ \"./src/utils/typed-array.ts\");\n\n\n\n\n\n\nvar CHUNK_SIZE = 16; // 16 bytes, 128 bits\nvar Decrypter = /*#__PURE__*/function () {\n function Decrypter(config, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$removePKCS7Paddi = _ref.removePKCS7Padding,\n removePKCS7Padding = _ref$removePKCS7Paddi === void 0 ? true : _ref$removePKCS7Paddi;\n this.logEnabled = true;\n this.removePKCS7Padding = void 0;\n this.subtle = null;\n this.softwareDecrypter = null;\n this.key = null;\n this.fastAesKey = null;\n this.remainderData = null;\n this.currentIV = null;\n this.currentResult = null;\n this.useSoftware = void 0;\n this.useSoftware = config.enableSoftwareAES;\n this.removePKCS7Padding = removePKCS7Padding;\n // built in decryptor expects PKCS7 padding\n if (removePKCS7Padding) {\n try {\n var browserCrypto = self.crypto;\n if (browserCrypto) {\n this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n }\n } catch (e) {\n /* no-op */\n }\n }\n if (this.subtle === null) {\n this.useSoftware = true;\n }\n }\n var _proto = Decrypter.prototype;\n _proto.destroy = function destroy() {\n this.subtle = null;\n this.softwareDecrypter = null;\n this.key = null;\n this.fastAesKey = null;\n this.remainderData = null;\n this.currentIV = null;\n this.currentResult = null;\n };\n _proto.isSync = function isSync() {\n return this.useSoftware;\n };\n _proto.flush = function flush() {\n var currentResult = this.currentResult,\n remainderData = this.remainderData;\n if (!currentResult || remainderData) {\n this.reset();\n return null;\n }\n var data = new Uint8Array(currentResult);\n this.reset();\n if (this.removePKCS7Padding) {\n return (0,_aes_decryptor__WEBPACK_IMPORTED_MODULE_2__.removePadding)(data);\n }\n return data;\n };\n _proto.reset = function reset() {\n this.currentResult = null;\n this.currentIV = null;\n this.remainderData = null;\n if (this.softwareDecrypter) {\n this.softwareDecrypter = null;\n }\n };\n _proto.decrypt = function decrypt(data, key, iv) {\n var _this = this;\n if (this.useSoftware) {\n return new Promise(function (resolve, reject) {\n _this.softwareDecrypt(new Uint8Array(data), key, iv);\n var decryptResult = _this.flush();\n if (decryptResult) {\n resolve(decryptResult.buffer);\n } else {\n reject(new Error('[softwareDecrypt] Failed to decrypt data'));\n }\n });\n }\n return this.webCryptoDecrypt(new Uint8Array(data), key, iv);\n }\n\n // Software decryption is progressive. Progressive decryption may not return a result on each call. Any cached\n // data is handled in the flush() call\n ;\n _proto.softwareDecrypt = function softwareDecrypt(data, key, iv) {\n var currentIV = this.currentIV,\n currentResult = this.currentResult,\n remainderData = this.remainderData;\n this.logOnce('JS AES decrypt');\n // The output is staggered during progressive parsing - the current result is cached, and emitted on the next call\n // This is done in order to strip PKCS7 padding, which is found at the end of each segment. We only know we've reached\n // the end on flush(), but by that time we have already received all bytes for the segment.\n // Progressive decryption does not work with WebCrypto\n\n if (remainderData) {\n data = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_4__.appendUint8Array)(remainderData, data);\n this.remainderData = null;\n }\n\n // Byte length must be a multiple of 16 (AES-128 = 128 bit blocks = 16 bytes)\n var currentChunk = this.getValidChunk(data);\n if (!currentChunk.length) {\n return null;\n }\n if (currentIV) {\n iv = currentIV;\n }\n var softwareDecrypter = this.softwareDecrypter;\n if (!softwareDecrypter) {\n softwareDecrypter = this.softwareDecrypter = new _aes_decryptor__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n }\n softwareDecrypter.expandKey(key);\n var result = currentResult;\n this.currentResult = softwareDecrypter.decrypt(currentChunk.buffer, 0, iv);\n this.currentIV = (0,_utils_typed_array__WEBPACK_IMPORTED_MODULE_5__.sliceUint8)(currentChunk, -16).buffer;\n if (!result) {\n return null;\n }\n return result;\n };\n _proto.webCryptoDecrypt = function webCryptoDecrypt(data, key, iv) {\n var _this2 = this;\n var subtle = this.subtle;\n if (this.key !== key || !this.fastAesKey) {\n this.key = key;\n this.fastAesKey = new _fast_aes_key__WEBPACK_IMPORTED_MODULE_1__[\"default\"](subtle, key);\n }\n return this.fastAesKey.expandKey().then(function (aesKey) {\n // decrypt using web crypto\n if (!subtle) {\n return Promise.reject(new Error('web crypto not initialized'));\n }\n _this2.logOnce('WebCrypto AES decrypt');\n var crypto = new _aes_crypto__WEBPACK_IMPORTED_MODULE_0__[\"default\"](subtle, new Uint8Array(iv));\n return crypto.decrypt(data.buffer, aesKey);\n }).catch(function (err) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.warn(\"[decrypter]: WebCrypto Error, disable WebCrypto API, \" + err.name + \": \" + err.message);\n return _this2.onWebCryptoError(data, key, iv);\n });\n };\n _proto.onWebCryptoError = function onWebCryptoError(data, key, iv) {\n this.useSoftware = true;\n this.logEnabled = true;\n this.softwareDecrypt(data, key, iv);\n var decryptResult = this.flush();\n if (decryptResult) {\n return decryptResult.buffer;\n }\n throw new Error('WebCrypto and softwareDecrypt: failed to decrypt data');\n };\n _proto.getValidChunk = function getValidChunk(data) {\n var currentChunk = data;\n var splitPoint = data.length - data.length % CHUNK_SIZE;\n if (splitPoint !== data.length) {\n currentChunk = (0,_utils_typed_array__WEBPACK_IMPORTED_MODULE_5__.sliceUint8)(data, 0, splitPoint);\n this.remainderData = (0,_utils_typed_array__WEBPACK_IMPORTED_MODULE_5__.sliceUint8)(data, splitPoint);\n }\n return currentChunk;\n };\n _proto.logOnce = function logOnce(msg) {\n if (!this.logEnabled) {\n return;\n }\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.log(\"[decrypter]: \" + msg);\n this.logEnabled = false;\n };\n return Decrypter;\n}();\n\n\n/***/ }),\n\n/***/ \"./src/crypt/fast-aes-key.ts\":\n/*!***********************************!*\\\n !*** ./src/crypt/fast-aes-key.ts ***!\n \\***********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ FastAESKey)\n/* harmony export */ });\nvar FastAESKey = /*#__PURE__*/function () {\n function FastAESKey(subtle, key) {\n this.subtle = void 0;\n this.key = void 0;\n this.subtle = subtle;\n this.key = key;\n }\n var _proto = FastAESKey.prototype;\n _proto.expandKey = function expandKey() {\n return this.subtle.importKey('raw', this.key, {\n name: 'AES-CBC'\n }, false, ['encrypt', 'decrypt']);\n };\n return FastAESKey;\n}();\n\n\n/***/ }),\n\n/***/ \"./src/demux/aacdemuxer.ts\":\n/*!*********************************!*\\\n !*** ./src/demux/aacdemuxer.ts ***!\n \\*********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _base_audio_demuxer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base-audio-demuxer */ \"./src/demux/base-audio-demuxer.ts\");\n/* harmony import */ var _adts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./adts */ \"./src/demux/adts.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _demux_id3__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../demux/id3 */ \"./src/demux/id3.ts\");\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n/**\n * AAC demuxer\n */\n\n\n\n\nvar AACDemuxer = /*#__PURE__*/function (_BaseAudioDemuxer) {\n _inheritsLoose(AACDemuxer, _BaseAudioDemuxer);\n function AACDemuxer(observer, config) {\n var _this;\n _this = _BaseAudioDemuxer.call(this) || this;\n _this.observer = void 0;\n _this.config = void 0;\n _this.observer = observer;\n _this.config = config;\n return _this;\n }\n var _proto = AACDemuxer.prototype;\n _proto.resetInitSegment = function resetInitSegment(initSegment, audioCodec, videoCodec, trackDuration) {\n _BaseAudioDemuxer.prototype.resetInitSegment.call(this, initSegment, audioCodec, videoCodec, trackDuration);\n this._audioTrack = {\n container: 'audio/adts',\n type: 'audio',\n id: 2,\n pid: -1,\n sequenceNumber: 0,\n segmentCodec: 'aac',\n samples: [],\n manifestCodec: audioCodec,\n duration: trackDuration,\n inputTimeScale: 90000,\n dropped: 0\n };\n }\n\n // Source for probe info - https://wiki.multimedia.cx/index.php?title=ADTS\n ;\n AACDemuxer.probe = function probe(data) {\n if (!data) {\n return false;\n }\n\n // Check for the ADTS sync word\n // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1\n // Layer bits (position 14 and 15) in header should be always 0 for ADTS\n // More info https://wiki.multimedia.cx/index.php?title=ADTS\n var id3Data = _demux_id3__WEBPACK_IMPORTED_MODULE_3__.getID3Data(data, 0) || [];\n var offset = id3Data.length;\n for (var length = data.length; offset < length; offset++) {\n if (_adts__WEBPACK_IMPORTED_MODULE_1__.probe(data, offset)) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log('ADTS sync word found !');\n return true;\n }\n }\n return false;\n };\n _proto.canParse = function canParse(data, offset) {\n return _adts__WEBPACK_IMPORTED_MODULE_1__.canParse(data, offset);\n };\n _proto.appendFrame = function appendFrame(track, data, offset) {\n _adts__WEBPACK_IMPORTED_MODULE_1__.initTrackConfig(track, this.observer, data, offset, track.manifestCodec);\n var frame = _adts__WEBPACK_IMPORTED_MODULE_1__.appendFrame(track, data, offset, this.basePTS, this.frameIndex);\n if (frame && frame.missing === 0) {\n return frame;\n }\n };\n return AACDemuxer;\n}(_base_audio_demuxer__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AACDemuxer);\n\n/***/ }),\n\n/***/ \"./src/demux/adts.ts\":\n/*!***************************!*\\\n !*** ./src/demux/adts.ts ***!\n \\***************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"appendFrame\": () => (/* binding */ appendFrame),\n/* harmony export */ \"canGetFrameLength\": () => (/* binding */ canGetFrameLength),\n/* harmony export */ \"canParse\": () => (/* binding */ canParse),\n/* harmony export */ \"getAudioConfig\": () => (/* binding */ getAudioConfig),\n/* harmony export */ \"getFrameDuration\": () => (/* binding */ getFrameDuration),\n/* harmony export */ \"getFullFrameLength\": () => (/* binding */ getFullFrameLength),\n/* harmony export */ \"getHeaderLength\": () => (/* binding */ getHeaderLength),\n/* harmony export */ \"initTrackConfig\": () => (/* binding */ initTrackConfig),\n/* harmony export */ \"isHeader\": () => (/* binding */ isHeader),\n/* harmony export */ \"isHeaderPattern\": () => (/* binding */ isHeaderPattern),\n/* harmony export */ \"parseFrameHeader\": () => (/* binding */ parseFrameHeader),\n/* harmony export */ \"probe\": () => (/* binding */ probe)\n/* harmony export */ });\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/**\n * ADTS parser helper\n * @link https://wiki.multimedia.cx/index.php?title=ADTS\n */\n\n\n\nfunction getAudioConfig(observer, data, offset, audioCodec) {\n var adtsObjectType;\n var adtsExtensionSamplingIndex;\n var adtsChannelConfig;\n var config;\n var userAgent = navigator.userAgent.toLowerCase();\n var manifestCodec = audioCodec;\n var adtsSamplingRates = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n // byte 2\n adtsObjectType = ((data[offset + 2] & 0xc0) >>> 6) + 1;\n var adtsSamplingIndex = (data[offset + 2] & 0x3c) >>> 2;\n if (adtsSamplingIndex > adtsSamplingRates.length - 1) {\n observer.trigger(_events__WEBPACK_IMPORTED_MODULE_2__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.FRAG_PARSING_ERROR,\n fatal: true,\n reason: \"invalid ADTS sampling index:\" + adtsSamplingIndex\n });\n return;\n }\n adtsChannelConfig = (data[offset + 2] & 0x01) << 2;\n // byte 3\n adtsChannelConfig |= (data[offset + 3] & 0xc0) >>> 6;\n _utils_logger__WEBPACK_IMPORTED_MODULE_0__.logger.log(\"manifest codec:\" + audioCodec + \", ADTS type:\" + adtsObjectType + \", samplingIndex:\" + adtsSamplingIndex);\n // firefox: freq less than 24kHz = AAC SBR (HE-AAC)\n if (/firefox/i.test(userAgent)) {\n if (adtsSamplingIndex >= 6) {\n adtsObjectType = 5;\n config = new Array(4);\n // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n // there is a factor 2 between frame sample rate and output sample rate\n // multiply frequency by 2 (see table below, equivalent to substract 3)\n adtsExtensionSamplingIndex = adtsSamplingIndex - 3;\n } else {\n adtsObjectType = 2;\n config = new Array(2);\n adtsExtensionSamplingIndex = adtsSamplingIndex;\n }\n // Android : always use AAC\n } else if (userAgent.indexOf('android') !== -1) {\n adtsObjectType = 2;\n config = new Array(2);\n adtsExtensionSamplingIndex = adtsSamplingIndex;\n } else {\n /* for other browsers (Chrome/Vivaldi/Opera ...)\n always force audio type to be HE-AAC SBR, as some browsers do not support audio codec switch properly (like Chrome ...)\n */\n adtsObjectType = 5;\n config = new Array(4);\n // if (manifest codec is HE-AAC or HE-AACv2) OR (manifest codec not specified AND frequency less than 24kHz)\n if (audioCodec && (audioCodec.indexOf('mp4a.40.29') !== -1 || audioCodec.indexOf('mp4a.40.5') !== -1) || !audioCodec && adtsSamplingIndex >= 6) {\n // HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies\n // there is a factor 2 between frame sample rate and output sample rate\n // multiply frequency by 2 (see table below, equivalent to substract 3)\n adtsExtensionSamplingIndex = adtsSamplingIndex - 3;\n } else {\n // if (manifest codec is AAC) AND (frequency less than 24kHz AND nb channel is 1) OR (manifest codec not specified and mono audio)\n // Chrome fails to play back with low frequency AAC LC mono when initialized with HE-AAC. This is not a problem with stereo.\n if (audioCodec && audioCodec.indexOf('mp4a.40.2') !== -1 && (adtsSamplingIndex >= 6 && adtsChannelConfig === 1 || /vivaldi/i.test(userAgent)) || !audioCodec && adtsChannelConfig === 1) {\n adtsObjectType = 2;\n config = new Array(2);\n }\n adtsExtensionSamplingIndex = adtsSamplingIndex;\n }\n }\n /* refer to http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio#Audio_Specific_Config\n ISO 14496-3 (AAC).pdf - Table 1.13 — Syntax of AudioSpecificConfig()\n Audio Profile / Audio Object Type\n 0: Null\n 1: AAC Main\n 2: AAC LC (Low Complexity)\n 3: AAC SSR (Scalable Sample Rate)\n 4: AAC LTP (Long Term Prediction)\n 5: SBR (Spectral Band Replication)\n 6: AAC Scalable\n sampling freq\n 0: 96000 Hz\n 1: 88200 Hz\n 2: 64000 Hz\n 3: 48000 Hz\n 4: 44100 Hz\n 5: 32000 Hz\n 6: 24000 Hz\n 7: 22050 Hz\n 8: 16000 Hz\n 9: 12000 Hz\n 10: 11025 Hz\n 11: 8000 Hz\n 12: 7350 Hz\n 13: Reserved\n 14: Reserved\n 15: frequency is written explictly\n Channel Configurations\n These are the channel configurations:\n 0: Defined in AOT Specifc Config\n 1: 1 channel: front-center\n 2: 2 channels: front-left, front-right\n */\n // audioObjectType = profile => profile, the MPEG-4 Audio Object Type minus 1\n config[0] = adtsObjectType << 3;\n // samplingFrequencyIndex\n config[0] |= (adtsSamplingIndex & 0x0e) >> 1;\n config[1] |= (adtsSamplingIndex & 0x01) << 7;\n // channelConfiguration\n config[1] |= adtsChannelConfig << 3;\n if (adtsObjectType === 5) {\n // adtsExtensionSamplingIndex\n config[1] |= (adtsExtensionSamplingIndex & 0x0e) >> 1;\n config[2] = (adtsExtensionSamplingIndex & 0x01) << 7;\n // adtsObjectType (force to 2, chrome is checking that object type is less than 5 ???\n // https://chromium.googlesource.com/chromium/src.git/+/master/media/formats/mp4/aac.cc\n config[2] |= 2 << 2;\n config[3] = 0;\n }\n return {\n config: config,\n samplerate: adtsSamplingRates[adtsSamplingIndex],\n channelCount: adtsChannelConfig,\n codec: 'mp4a.40.' + adtsObjectType,\n manifestCodec: manifestCodec\n };\n}\nfunction isHeaderPattern(data, offset) {\n return data[offset] === 0xff && (data[offset + 1] & 0xf6) === 0xf0;\n}\nfunction getHeaderLength(data, offset) {\n return data[offset + 1] & 0x01 ? 7 : 9;\n}\nfunction getFullFrameLength(data, offset) {\n return (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xe0) >>> 5;\n}\nfunction canGetFrameLength(data, offset) {\n return offset + 5 < data.length;\n}\nfunction isHeader(data, offset) {\n // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1\n // Layer bits (position 14 and 15) in header should be always 0 for ADTS\n // More info https://wiki.multimedia.cx/index.php?title=ADTS\n return offset + 1 < data.length && isHeaderPattern(data, offset);\n}\nfunction canParse(data, offset) {\n return canGetFrameLength(data, offset) && isHeaderPattern(data, offset) && getFullFrameLength(data, offset) <= data.length - offset;\n}\nfunction probe(data, offset) {\n // same as isHeader but we also check that ADTS frame follows last ADTS frame\n // or end of data is reached\n if (isHeader(data, offset)) {\n // ADTS header Length\n var headerLength = getHeaderLength(data, offset);\n if (offset + headerLength >= data.length) {\n return false;\n }\n // ADTS frame Length\n var frameLength = getFullFrameLength(data, offset);\n if (frameLength <= headerLength) {\n return false;\n }\n var newOffset = offset + frameLength;\n return newOffset === data.length || isHeader(data, newOffset);\n }\n return false;\n}\nfunction initTrackConfig(track, observer, data, offset, audioCodec) {\n if (!track.samplerate) {\n var config = getAudioConfig(observer, data, offset, audioCodec);\n if (!config) {\n return;\n }\n track.config = config.config;\n track.samplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n _utils_logger__WEBPACK_IMPORTED_MODULE_0__.logger.log(\"parsed codec:\" + track.codec + \", rate:\" + config.samplerate + \", channels:\" + config.channelCount);\n }\n}\nfunction getFrameDuration(samplerate) {\n return 1024 * 90000 / samplerate;\n}\nfunction parseFrameHeader(data, offset) {\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n var headerLength = getHeaderLength(data, offset);\n if (offset + headerLength <= data.length) {\n // retrieve frame size\n var frameLength = getFullFrameLength(data, offset) - headerLength;\n if (frameLength > 0) {\n // logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}`);\n return {\n headerLength: headerLength,\n frameLength: frameLength\n };\n }\n }\n}\nfunction appendFrame(track, data, offset, pts, frameIndex) {\n var frameDuration = getFrameDuration(track.samplerate);\n var stamp = pts + frameIndex * frameDuration;\n var header = parseFrameHeader(data, offset);\n var unit;\n if (header) {\n var frameLength = header.frameLength,\n headerLength = header.headerLength;\n var _length = headerLength + frameLength;\n var missing = Math.max(0, offset + _length - data.length);\n // logger.log(`AAC frame ${frameIndex}, pts:${stamp} length@offset/total: ${frameLength}@${offset+headerLength}/${data.byteLength} missing: ${missing}`);\n if (missing) {\n unit = new Uint8Array(_length - headerLength);\n unit.set(data.subarray(offset + headerLength, data.length), 0);\n } else {\n unit = data.subarray(offset + headerLength, offset + _length);\n }\n var _sample = {\n unit: unit,\n pts: stamp\n };\n if (!missing) {\n track.samples.push(_sample);\n }\n return {\n sample: _sample,\n length: _length,\n missing: missing\n };\n }\n // overflow incomplete header\n var length = data.length - offset;\n unit = new Uint8Array(length);\n unit.set(data.subarray(offset, data.length), 0);\n var sample = {\n unit: unit,\n pts: stamp\n };\n return {\n sample: sample,\n length: length,\n missing: -1\n };\n}\n\n/***/ }),\n\n/***/ \"./src/demux/base-audio-demuxer.ts\":\n/*!*****************************************!*\\\n !*** ./src/demux/base-audio-demuxer.ts ***!\n \\*****************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ \"initPTSFn\": () => (/* binding */ initPTSFn)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _demux_id3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../demux/id3 */ \"./src/demux/id3.ts\");\n/* harmony import */ var _types_demuxer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../types/demuxer */ \"./src/types/demuxer.ts\");\n/* harmony import */ var _dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dummy-demuxed-track */ \"./src/demux/dummy-demuxed-track.ts\");\n/* harmony import */ var _utils_mp4_tools__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/mp4-tools */ \"./src/utils/mp4-tools.ts\");\n/* harmony import */ var _utils_typed_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/typed-array */ \"./src/utils/typed-array.ts\");\n\n\n\n\n\n\n\nvar BaseAudioDemuxer = /*#__PURE__*/function () {\n function BaseAudioDemuxer() {\n this._audioTrack = void 0;\n this._id3Track = void 0;\n this.frameIndex = 0;\n this.cachedData = null;\n this.basePTS = null;\n this.initPTS = null;\n this.lastPTS = null;\n }\n var _proto = BaseAudioDemuxer.prototype;\n _proto.resetInitSegment = function resetInitSegment(initSegment, audioCodec, videoCodec, trackDuration) {\n this._id3Track = {\n type: 'id3',\n id: 3,\n pid: -1,\n inputTimeScale: 90000,\n sequenceNumber: 0,\n samples: [],\n dropped: 0\n };\n };\n _proto.resetTimeStamp = function resetTimeStamp(deaultTimestamp) {\n this.initPTS = deaultTimestamp;\n this.resetContiguity();\n };\n _proto.resetContiguity = function resetContiguity() {\n this.basePTS = null;\n this.lastPTS = null;\n this.frameIndex = 0;\n };\n _proto.canParse = function canParse(data, offset) {\n return false;\n };\n _proto.appendFrame = function appendFrame(track, data, offset) {}\n\n // feed incoming data to the front of the parsing pipeline\n ;\n _proto.demux = function demux(data, timeOffset) {\n if (this.cachedData) {\n data = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_4__.appendUint8Array)(this.cachedData, data);\n this.cachedData = null;\n }\n var id3Data = _demux_id3__WEBPACK_IMPORTED_MODULE_1__.getID3Data(data, 0);\n var offset = id3Data ? id3Data.length : 0;\n var lastDataIndex;\n var track = this._audioTrack;\n var id3Track = this._id3Track;\n var timestamp = id3Data ? _demux_id3__WEBPACK_IMPORTED_MODULE_1__.getTimeStamp(id3Data) : undefined;\n var length = data.length;\n if (this.basePTS === null || this.frameIndex === 0 && (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(timestamp)) {\n this.basePTS = initPTSFn(timestamp, timeOffset, this.initPTS);\n this.lastPTS = this.basePTS;\n }\n if (this.lastPTS === null) {\n this.lastPTS = this.basePTS;\n }\n\n // more expressive than alternative: id3Data?.length\n if (id3Data && id3Data.length > 0) {\n id3Track.samples.push({\n pts: this.lastPTS,\n dts: this.lastPTS,\n data: id3Data,\n type: _types_demuxer__WEBPACK_IMPORTED_MODULE_2__.MetadataSchema.audioId3,\n duration: Number.POSITIVE_INFINITY\n });\n }\n while (offset < length) {\n if (this.canParse(data, offset)) {\n var frame = this.appendFrame(track, data, offset);\n if (frame) {\n this.frameIndex++;\n this.lastPTS = frame.sample.pts;\n offset += frame.length;\n lastDataIndex = offset;\n } else {\n offset = length;\n }\n } else if (_demux_id3__WEBPACK_IMPORTED_MODULE_1__.canParse(data, offset)) {\n // after a ID3.canParse, a call to ID3.getID3Data *should* always returns some data\n id3Data = _demux_id3__WEBPACK_IMPORTED_MODULE_1__.getID3Data(data, offset);\n id3Track.samples.push({\n pts: this.lastPTS,\n dts: this.lastPTS,\n data: id3Data,\n type: _types_demuxer__WEBPACK_IMPORTED_MODULE_2__.MetadataSchema.audioId3,\n duration: Number.POSITIVE_INFINITY\n });\n offset += id3Data.length;\n lastDataIndex = offset;\n } else {\n offset++;\n }\n if (offset === length && lastDataIndex !== length) {\n var partialData = (0,_utils_typed_array__WEBPACK_IMPORTED_MODULE_5__.sliceUint8)(data, lastDataIndex);\n if (this.cachedData) {\n this.cachedData = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_4__.appendUint8Array)(this.cachedData, partialData);\n } else {\n this.cachedData = partialData;\n }\n }\n }\n return {\n audioTrack: track,\n videoTrack: (0,_dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__.dummyTrack)(),\n id3Track: id3Track,\n textTrack: (0,_dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__.dummyTrack)()\n };\n };\n _proto.demuxSampleAes = function demuxSampleAes(data, keyData, timeOffset) {\n return Promise.reject(new Error(\"[\" + this + \"] This demuxer does not support Sample-AES decryption\"));\n };\n _proto.flush = function flush(timeOffset) {\n // Parse cache in case of remaining frames.\n var cachedData = this.cachedData;\n if (cachedData) {\n this.cachedData = null;\n this.demux(cachedData, 0);\n }\n return {\n audioTrack: this._audioTrack,\n videoTrack: (0,_dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__.dummyTrack)(),\n id3Track: this._id3Track,\n textTrack: (0,_dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__.dummyTrack)()\n };\n };\n _proto.destroy = function destroy() {};\n return BaseAudioDemuxer;\n}();\n/**\n * Initialize PTS\n * <p>\n * use timestamp unless it is undefined, NaN or Infinity\n * </p>\n */\nvar initPTSFn = function initPTSFn(timestamp, timeOffset, initPTS) {\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(timestamp)) {\n return timestamp * 90;\n }\n return timeOffset * 90000 + (initPTS || 0);\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseAudioDemuxer);\n\n/***/ }),\n\n/***/ \"./src/demux/chunk-cache.ts\":\n/*!**********************************!*\\\n !*** ./src/demux/chunk-cache.ts ***!\n \\**********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ChunkCache)\n/* harmony export */ });\nvar ChunkCache = /*#__PURE__*/function () {\n function ChunkCache() {\n this.chunks = [];\n this.dataLength = 0;\n }\n var _proto = ChunkCache.prototype;\n _proto.push = function push(chunk) {\n this.chunks.push(chunk);\n this.dataLength += chunk.length;\n };\n _proto.flush = function flush() {\n var chunks = this.chunks,\n dataLength = this.dataLength;\n var result;\n if (!chunks.length) {\n return new Uint8Array(0);\n } else if (chunks.length === 1) {\n result = chunks[0];\n } else {\n result = concatUint8Arrays(chunks, dataLength);\n }\n this.reset();\n return result;\n };\n _proto.reset = function reset() {\n this.chunks.length = 0;\n this.dataLength = 0;\n };\n return ChunkCache;\n}();\n\nfunction concatUint8Arrays(chunks, dataLength) {\n var result = new Uint8Array(dataLength);\n var offset = 0;\n for (var i = 0; i < chunks.length; i++) {\n var chunk = chunks[i];\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n}\n\n/***/ }),\n\n/***/ \"./src/demux/dummy-demuxed-track.ts\":\n/*!******************************************!*\\\n !*** ./src/demux/dummy-demuxed-track.ts ***!\n \\******************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"dummyTrack\": () => (/* binding */ dummyTrack)\n/* harmony export */ });\nfunction dummyTrack(type, inputTimeScale) {\n if (type === void 0) {\n type = '';\n }\n if (inputTimeScale === void 0) {\n inputTimeScale = 90000;\n }\n return {\n type: type,\n id: -1,\n pid: -1,\n inputTimeScale: inputTimeScale,\n sequenceNumber: -1,\n samples: [],\n dropped: 0\n };\n}\n\n/***/ }),\n\n/***/ \"./src/demux/exp-golomb.ts\":\n/*!*********************************!*\\\n !*** ./src/demux/exp-golomb.ts ***!\n \\*********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.\n */\n\n\nvar ExpGolomb = /*#__PURE__*/function () {\n function ExpGolomb(data) {\n this.data = void 0;\n this.bytesAvailable = void 0;\n this.word = void 0;\n this.bitsAvailable = void 0;\n this.data = data;\n // the number of bytes left to examine in this.data\n this.bytesAvailable = data.byteLength;\n // the current word being examined\n this.word = 0; // :uint\n // the number of bits left to examine in the current word\n this.bitsAvailable = 0; // :uint\n }\n\n // ():void\n var _proto = ExpGolomb.prototype;\n _proto.loadWord = function loadWord() {\n var data = this.data;\n var bytesAvailable = this.bytesAvailable;\n var position = data.byteLength - bytesAvailable;\n var workingBytes = new Uint8Array(4);\n var availableBytes = Math.min(4, bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(data.subarray(position, position + availableBytes));\n this.word = new DataView(workingBytes.buffer).getUint32(0);\n // track the amount of this.data that has been processed\n this.bitsAvailable = availableBytes * 8;\n this.bytesAvailable -= availableBytes;\n }\n\n // (count:int):void\n ;\n _proto.skipBits = function skipBits(count) {\n var skipBytes; // :int\n count = Math.min(count, this.bytesAvailable * 8 + this.bitsAvailable);\n if (this.bitsAvailable > count) {\n this.word <<= count;\n this.bitsAvailable -= count;\n } else {\n count -= this.bitsAvailable;\n skipBytes = count >> 3;\n count -= skipBytes << 3;\n this.bytesAvailable -= skipBytes;\n this.loadWord();\n this.word <<= count;\n this.bitsAvailable -= count;\n }\n }\n\n // (size:int):uint\n ;\n _proto.readBits = function readBits(size) {\n var bits = Math.min(this.bitsAvailable, size); // :uint\n var valu = this.word >>> 32 - bits; // :uint\n if (size > 32) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_0__.logger.error('Cannot read more than 32 bits at a time');\n }\n this.bitsAvailable -= bits;\n if (this.bitsAvailable > 0) {\n this.word <<= bits;\n } else if (this.bytesAvailable > 0) {\n this.loadWord();\n } else {\n throw new Error('no bits available');\n }\n bits = size - bits;\n if (bits > 0 && this.bitsAvailable) {\n return valu << bits | this.readBits(bits);\n } else {\n return valu;\n }\n }\n\n // ():uint\n ;\n _proto.skipLZ = function skipLZ() {\n var leadingZeroCount; // :uint\n for (leadingZeroCount = 0; leadingZeroCount < this.bitsAvailable; ++leadingZeroCount) {\n if ((this.word & 0x80000000 >>> leadingZeroCount) !== 0) {\n // the first bit of working word is 1\n this.word <<= leadingZeroCount;\n this.bitsAvailable -= leadingZeroCount;\n return leadingZeroCount;\n }\n }\n // we exhausted word and still have not found a 1\n this.loadWord();\n return leadingZeroCount + this.skipLZ();\n }\n\n // ():void\n ;\n _proto.skipUEG = function skipUEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():void\n ;\n _proto.skipEG = function skipEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():uint\n ;\n _proto.readUEG = function readUEG() {\n var clz = this.skipLZ(); // :uint\n return this.readBits(clz + 1) - 1;\n }\n\n // ():int\n ;\n _proto.readEG = function readEG() {\n var valu = this.readUEG(); // :int\n if (0x01 & valu) {\n // the number is odd if the low order bit is set\n return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n } else {\n return -1 * (valu >>> 1); // divide by two then make it negative\n }\n }\n\n // Some convenience functions\n // :Boolean\n ;\n _proto.readBoolean = function readBoolean() {\n return this.readBits(1) === 1;\n }\n\n // ():int\n ;\n _proto.readUByte = function readUByte() {\n return this.readBits(8);\n }\n\n // ():int\n ;\n _proto.readUShort = function readUShort() {\n return this.readBits(16);\n }\n\n // ():int\n ;\n _proto.readUInt = function readUInt() {\n return this.readBits(32);\n }\n\n /**\n * Advance the ExpGolomb decoder past a scaling list. The scaling\n * list is optionally transmitted as part of a sequence parameter\n * set and is not relevant to transmuxing.\n * @param count the number of entries in this scaling list\n * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n */;\n _proto.skipScalingList = function skipScalingList(count) {\n var lastScale = 8;\n var nextScale = 8;\n var deltaScale;\n for (var j = 0; j < count; j++) {\n if (nextScale !== 0) {\n deltaScale = this.readEG();\n nextScale = (lastScale + deltaScale + 256) % 256;\n }\n lastScale = nextScale === 0 ? lastScale : nextScale;\n }\n }\n\n /**\n * Read a sequence parameter set and return some interesting video\n * properties. A sequence parameter set is the H264 metadata that\n * describes the properties of upcoming video frames.\n * @param data {Uint8Array} the bytes of a sequence parameter set\n * @return {object} an object with configuration parsed from the\n * sequence parameter set, including the dimensions of the\n * associated video frames.\n */;\n _proto.readSPS = function readSPS() {\n var frameCropLeftOffset = 0;\n var frameCropRightOffset = 0;\n var frameCropTopOffset = 0;\n var frameCropBottomOffset = 0;\n var numRefFramesInPicOrderCntCycle;\n var scalingListCount;\n var i;\n var readUByte = this.readUByte.bind(this);\n var readBits = this.readBits.bind(this);\n var readUEG = this.readUEG.bind(this);\n var readBoolean = this.readBoolean.bind(this);\n var skipBits = this.skipBits.bind(this);\n var skipEG = this.skipEG.bind(this);\n var skipUEG = this.skipUEG.bind(this);\n var skipScalingList = this.skipScalingList.bind(this);\n readUByte();\n var profileIdc = readUByte(); // profile_idc\n readBits(5); // profileCompat constraint_set[0-4]_flag, u(5)\n skipBits(3); // reserved_zero_3bits u(3),\n readUByte(); // level_idc u(8)\n skipUEG(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n if (profileIdc === 100 || profileIdc === 110 || profileIdc === 122 || profileIdc === 244 || profileIdc === 44 || profileIdc === 83 || profileIdc === 86 || profileIdc === 118 || profileIdc === 128) {\n var chromaFormatIdc = readUEG();\n if (chromaFormatIdc === 3) {\n skipBits(1);\n } // separate_colour_plane_flag\n\n skipUEG(); // bit_depth_luma_minus8\n skipUEG(); // bit_depth_chroma_minus8\n skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (readBoolean()) {\n // seq_scaling_matrix_present_flag\n scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (readBoolean()) {\n // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16);\n } else {\n skipScalingList(64);\n }\n }\n }\n }\n }\n skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = readUEG();\n if (picOrderCntType === 0) {\n readUEG(); // log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n skipBits(1); // delta_pic_order_always_zero_flag\n skipEG(); // offset_for_non_ref_pic\n skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = readUEG();\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n skipEG();\n } // offset_for_ref_frame[ i ]\n }\n\n skipUEG(); // max_num_ref_frames\n skipBits(1); // gaps_in_frame_num_value_allowed_flag\n var picWidthInMbsMinus1 = readUEG();\n var picHeightInMapUnitsMinus1 = readUEG();\n var frameMbsOnlyFlag = readBits(1);\n if (frameMbsOnlyFlag === 0) {\n skipBits(1);\n } // mb_adaptive_frame_field_flag\n\n skipBits(1); // direct_8x8_inference_flag\n if (readBoolean()) {\n // frame_cropping_flag\n frameCropLeftOffset = readUEG();\n frameCropRightOffset = readUEG();\n frameCropTopOffset = readUEG();\n frameCropBottomOffset = readUEG();\n }\n var pixelRatio = [1, 1];\n if (readBoolean()) {\n // vui_parameters_present_flag\n if (readBoolean()) {\n // aspect_ratio_info_present_flag\n var aspectRatioIdc = readUByte();\n switch (aspectRatioIdc) {\n case 1:\n pixelRatio = [1, 1];\n break;\n case 2:\n pixelRatio = [12, 11];\n break;\n case 3:\n pixelRatio = [10, 11];\n break;\n case 4:\n pixelRatio = [16, 11];\n break;\n case 5:\n pixelRatio = [40, 33];\n break;\n case 6:\n pixelRatio = [24, 11];\n break;\n case 7:\n pixelRatio = [20, 11];\n break;\n case 8:\n pixelRatio = [32, 11];\n break;\n case 9:\n pixelRatio = [80, 33];\n break;\n case 10:\n pixelRatio = [18, 11];\n break;\n case 11:\n pixelRatio = [15, 11];\n break;\n case 12:\n pixelRatio = [64, 33];\n break;\n case 13:\n pixelRatio = [160, 99];\n break;\n case 14:\n pixelRatio = [4, 3];\n break;\n case 15:\n pixelRatio = [3, 2];\n break;\n case 16:\n pixelRatio = [2, 1];\n break;\n case 255:\n {\n pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];\n break;\n }\n }\n }\n }\n return {\n width: Math.ceil((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2),\n height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - (frameMbsOnlyFlag ? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset),\n pixelRatio: pixelRatio\n };\n };\n _proto.readSliceType = function readSliceType() {\n // skip NALu type\n this.readUByte();\n // discard first_mb_in_slice\n this.readUEG();\n // return slice_type\n return this.readUEG();\n };\n return ExpGolomb;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ExpGolomb);\n\n/***/ }),\n\n/***/ \"./src/demux/id3.ts\":\n/*!**************************!*\\\n !*** ./src/demux/id3.ts ***!\n \\**************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"canParse\": () => (/* binding */ canParse),\n/* harmony export */ \"decodeFrame\": () => (/* binding */ decodeFrame),\n/* harmony export */ \"getID3Data\": () => (/* binding */ getID3Data),\n/* harmony export */ \"getID3Frames\": () => (/* binding */ getID3Frames),\n/* harmony export */ \"getTimeStamp\": () => (/* binding */ getTimeStamp),\n/* harmony export */ \"isFooter\": () => (/* binding */ isFooter),\n/* harmony export */ \"isHeader\": () => (/* binding */ isHeader),\n/* harmony export */ \"isTimeStampFrame\": () => (/* binding */ isTimeStampFrame),\n/* harmony export */ \"testables\": () => (/* binding */ testables),\n/* harmony export */ \"utf8ArrayToStr\": () => (/* binding */ utf8ArrayToStr)\n/* harmony export */ });\n// breaking up those two types in order to clarify what is happening in the decoding path.\n\n/**\n * Returns true if an ID3 header can be found at offset in data\n * @param {Uint8Array} data - The data to search in\n * @param {number} offset - The offset at which to start searching\n * @return {boolean} - True if an ID3 header is found\n */\nvar isHeader = function isHeader(data, offset) {\n /*\n * http://id3.org/id3v2.3.0\n * [0] = 'I'\n * [1] = 'D'\n * [2] = '3'\n * [3,4] = {Version}\n * [5] = {Flags}\n * [6-9] = {ID3 Size}\n *\n * An ID3v2 tag can be detected with the following pattern:\n * $49 44 33 yy yy xx zz zz zz zz\n * Where yy is less than $FF, xx is the 'flags' byte and zz is less than $80\n */\n if (offset + 10 <= data.length) {\n // look for 'ID3' identifier\n if (data[offset] === 0x49 && data[offset + 1] === 0x44 && data[offset + 2] === 0x33) {\n // check version is within range\n if (data[offset + 3] < 0xff && data[offset + 4] < 0xff) {\n // check size is within range\n if (data[offset + 6] < 0x80 && data[offset + 7] < 0x80 && data[offset + 8] < 0x80 && data[offset + 9] < 0x80) {\n return true;\n }\n }\n }\n }\n return false;\n};\n\n/**\n * Returns true if an ID3 footer can be found at offset in data\n * @param {Uint8Array} data - The data to search in\n * @param {number} offset - The offset at which to start searching\n * @return {boolean} - True if an ID3 footer is found\n */\nvar isFooter = function isFooter(data, offset) {\n /*\n * The footer is a copy of the header, but with a different identifier\n */\n if (offset + 10 <= data.length) {\n // look for '3DI' identifier\n if (data[offset] === 0x33 && data[offset + 1] === 0x44 && data[offset + 2] === 0x49) {\n // check version is within range\n if (data[offset + 3] < 0xff && data[offset + 4] < 0xff) {\n // check size is within range\n if (data[offset + 6] < 0x80 && data[offset + 7] < 0x80 && data[offset + 8] < 0x80 && data[offset + 9] < 0x80) {\n return true;\n }\n }\n }\n }\n return false;\n};\n\n/**\n * Returns any adjacent ID3 tags found in data starting at offset, as one block of data\n * @param {Uint8Array} data - The data to search in\n * @param {number} offset - The offset at which to start searching\n * @return {Uint8Array | undefined} - The block of data containing any ID3 tags found\n * or *undefined* if no header is found at the starting offset\n */\nvar getID3Data = function getID3Data(data, offset) {\n var front = offset;\n var length = 0;\n while (isHeader(data, offset)) {\n // ID3 header is 10 bytes\n length += 10;\n var size = readSize(data, offset + 6);\n length += size;\n if (isFooter(data, offset + 10)) {\n // ID3 footer is 10 bytes\n length += 10;\n }\n offset += length;\n }\n if (length > 0) {\n return data.subarray(front, front + length);\n }\n return undefined;\n};\nvar readSize = function readSize(data, offset) {\n var size = 0;\n size = (data[offset] & 0x7f) << 21;\n size |= (data[offset + 1] & 0x7f) << 14;\n size |= (data[offset + 2] & 0x7f) << 7;\n size |= data[offset + 3] & 0x7f;\n return size;\n};\nvar canParse = function canParse(data, offset) {\n return isHeader(data, offset) && readSize(data, offset + 6) + 10 <= data.length - offset;\n};\n\n/**\n * Searches for the Elementary Stream timestamp found in the ID3 data chunk\n * @param {Uint8Array} data - Block of data containing one or more ID3 tags\n * @return {number | undefined} - The timestamp\n */\nvar getTimeStamp = function getTimeStamp(data) {\n var frames = getID3Frames(data);\n for (var i = 0; i < frames.length; i++) {\n var frame = frames[i];\n if (isTimeStampFrame(frame)) {\n return readTimeStamp(frame);\n }\n }\n return undefined;\n};\n\n/**\n * Returns true if the ID3 frame is an Elementary Stream timestamp frame\n * @param {ID3 frame} frame\n */\nvar isTimeStampFrame = function isTimeStampFrame(frame) {\n return frame && frame.key === 'PRIV' && frame.info === 'com.apple.streaming.transportStreamTimestamp';\n};\nvar getFrameData = function getFrameData(data) {\n /*\n Frame ID $xx xx xx xx (four characters)\n Size $xx xx xx xx\n Flags $xx xx\n */\n var type = String.fromCharCode(data[0], data[1], data[2], data[3]);\n var size = readSize(data, 4);\n\n // skip frame id, size, and flags\n var offset = 10;\n return {\n type: type,\n size: size,\n data: data.subarray(offset, offset + size)\n };\n};\n\n/**\n * Returns an array of ID3 frames found in all the ID3 tags in the id3Data\n * @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags\n * @return {ID3.Frame[]} - Array of ID3 frame objects\n */\nvar getID3Frames = function getID3Frames(id3Data) {\n var offset = 0;\n var frames = [];\n while (isHeader(id3Data, offset)) {\n var size = readSize(id3Data, offset + 6);\n // skip past ID3 header\n offset += 10;\n var end = offset + size;\n // loop through frames in the ID3 tag\n while (offset + 8 < end) {\n var frameData = getFrameData(id3Data.subarray(offset));\n var frame = decodeFrame(frameData);\n if (frame) {\n frames.push(frame);\n }\n\n // skip frame header and frame data\n offset += frameData.size + 10;\n }\n if (isFooter(id3Data, offset)) {\n offset += 10;\n }\n }\n return frames;\n};\nvar decodeFrame = function decodeFrame(frame) {\n if (frame.type === 'PRIV') {\n return decodePrivFrame(frame);\n } else if (frame.type[0] === 'W') {\n return decodeURLFrame(frame);\n }\n return decodeTextFrame(frame);\n};\nvar decodePrivFrame = function decodePrivFrame(frame) {\n /*\n Format: <text string>\\0<binary data>\n */\n if (frame.size < 2) {\n return undefined;\n }\n var owner = utf8ArrayToStr(frame.data, true);\n var privateData = new Uint8Array(frame.data.subarray(owner.length + 1));\n return {\n key: frame.type,\n info: owner,\n data: privateData.buffer\n };\n};\nvar decodeTextFrame = function decodeTextFrame(frame) {\n if (frame.size < 2) {\n return undefined;\n }\n if (frame.type === 'TXXX') {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Description}\\0{Value}\n */\n var index = 1;\n var description = utf8ArrayToStr(frame.data.subarray(index), true);\n index += description.length + 1;\n var value = utf8ArrayToStr(frame.data.subarray(index));\n return {\n key: frame.type,\n info: description,\n data: value\n };\n }\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Value}\n */\n var text = utf8ArrayToStr(frame.data.subarray(1));\n return {\n key: frame.type,\n data: text\n };\n};\nvar decodeURLFrame = function decodeURLFrame(frame) {\n if (frame.type === 'WXXX') {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Description}\\0{URL}\n */\n if (frame.size < 2) {\n return undefined;\n }\n var index = 1;\n var description = utf8ArrayToStr(frame.data.subarray(index), true);\n index += description.length + 1;\n var value = utf8ArrayToStr(frame.data.subarray(index));\n return {\n key: frame.type,\n info: description,\n data: value\n };\n }\n /*\n Format:\n [0-?] = {URL}\n */\n var url = utf8ArrayToStr(frame.data);\n return {\n key: frame.type,\n data: url\n };\n};\nvar readTimeStamp = function readTimeStamp(timeStampFrame) {\n if (timeStampFrame.data.byteLength === 8) {\n var data = new Uint8Array(timeStampFrame.data);\n // timestamp is 33 bit expressed as a big-endian eight-octet number,\n // with the upper 31 bits set to zero.\n var pts33Bit = data[3] & 0x1;\n var timestamp = (data[4] << 23) + (data[5] << 15) + (data[6] << 7) + data[7];\n timestamp /= 45;\n if (pts33Bit) {\n timestamp += 47721858.84;\n } // 2^32 / 90\n\n return Math.round(timestamp);\n }\n return undefined;\n};\n\n// http://stackoverflow.com/questions/8936984/uint8array-to-string-in-javascript/22373197\n// http://www.onicos.com/staff/iz/amuse/javascript/expert/utf.txt\n/* utf.js - UTF-8 <=> UTF-16 convertion\n *\n * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>\n * Version: 1.0\n * LastModified: Dec 25 1999\n * This library is free. You can redistribute it and/or modify it.\n */\nvar utf8ArrayToStr = function utf8ArrayToStr(array, exitOnNull) {\n if (exitOnNull === void 0) {\n exitOnNull = false;\n }\n var decoder = getTextDecoder();\n if (decoder) {\n var decoded = decoder.decode(array);\n if (exitOnNull) {\n // grab up to the first null\n var idx = decoded.indexOf('\\0');\n return idx !== -1 ? decoded.substring(0, idx) : decoded;\n }\n\n // remove any null characters\n return decoded.replace(/\\0/g, '');\n }\n var len = array.length;\n var c;\n var char2;\n var char3;\n var out = '';\n var i = 0;\n while (i < len) {\n c = array[i++];\n if (c === 0x00 && exitOnNull) {\n return out;\n } else if (c === 0x00 || c === 0x03) {\n // If the character is 3 (END_OF_TEXT) or 0 (NULL) then skip it\n continue;\n }\n switch (c >> 4) {\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12:\n case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode((c & 0x1f) << 6 | char2 & 0x3f);\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode((c & 0x0f) << 12 | (char2 & 0x3f) << 6 | (char3 & 0x3f) << 0);\n break;\n default:\n }\n }\n return out;\n};\nvar testables = {\n decodeTextFrame: decodeTextFrame\n};\nvar decoder;\nfunction getTextDecoder() {\n if (!decoder && typeof self.TextDecoder !== 'undefined') {\n decoder = new self.TextDecoder('utf-8');\n }\n return decoder;\n}\n\n/***/ }),\n\n/***/ \"./src/demux/mp3demuxer.ts\":\n/*!*********************************!*\\\n !*** ./src/demux/mp3demuxer.ts ***!\n \\*********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _base_audio_demuxer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base-audio-demuxer */ \"./src/demux/base-audio-demuxer.ts\");\n/* harmony import */ var _demux_id3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../demux/id3 */ \"./src/demux/id3.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _mpegaudio__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mpegaudio */ \"./src/demux/mpegaudio.ts\");\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n/**\n * MP3 demuxer\n */\n\n\n\n\nvar MP3Demuxer = /*#__PURE__*/function (_BaseAudioDemuxer) {\n _inheritsLoose(MP3Demuxer, _BaseAudioDemuxer);\n function MP3Demuxer() {\n return _BaseAudioDemuxer.apply(this, arguments) || this;\n }\n var _proto = MP3Demuxer.prototype;\n _proto.resetInitSegment = function resetInitSegment(initSegment, audioCodec, videoCodec, trackDuration) {\n _BaseAudioDemuxer.prototype.resetInitSegment.call(this, initSegment, audioCodec, videoCodec, trackDuration);\n this._audioTrack = {\n container: 'audio/mpeg',\n type: 'audio',\n id: 2,\n pid: -1,\n sequenceNumber: 0,\n segmentCodec: 'mp3',\n samples: [],\n manifestCodec: audioCodec,\n duration: trackDuration,\n inputTimeScale: 90000,\n dropped: 0\n };\n };\n MP3Demuxer.probe = function probe(data) {\n if (!data) {\n return false;\n }\n\n // check if data contains ID3 timestamp and MPEG sync word\n // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1\n // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)\n // More info http://www.mp3-tech.org/programmer/frame_header.html\n var id3Data = _demux_id3__WEBPACK_IMPORTED_MODULE_1__.getID3Data(data, 0) || [];\n var offset = id3Data.length;\n for (var length = data.length; offset < length; offset++) {\n if (_mpegaudio__WEBPACK_IMPORTED_MODULE_3__.probe(data, offset)) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.log('MPEG Audio sync word found !');\n return true;\n }\n }\n return false;\n };\n _proto.canParse = function canParse(data, offset) {\n return _mpegaudio__WEBPACK_IMPORTED_MODULE_3__.canParse(data, offset);\n };\n _proto.appendFrame = function appendFrame(track, data, offset) {\n if (this.basePTS === null) {\n return;\n }\n return _mpegaudio__WEBPACK_IMPORTED_MODULE_3__.appendFrame(track, data, offset, this.basePTS, this.frameIndex);\n };\n return MP3Demuxer;\n}(_base_audio_demuxer__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MP3Demuxer);\n\n/***/ }),\n\n/***/ \"./src/demux/mp4demuxer.ts\":\n/*!*********************************!*\\\n !*** ./src/demux/mp4demuxer.ts ***!\n \\*********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _types_demuxer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types/demuxer */ \"./src/types/demuxer.ts\");\n/* harmony import */ var _utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/mp4-tools */ \"./src/utils/mp4-tools.ts\");\n/* harmony import */ var _dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dummy-demuxed-track */ \"./src/demux/dummy-demuxed-track.ts\");\n\n/**\n * MP4 demuxer\n */\n\n\n\nvar emsgSchemePattern = /\\/emsg[-/]ID3/i;\nvar MP4Demuxer = /*#__PURE__*/function () {\n function MP4Demuxer(observer, config) {\n this.remainderData = null;\n this.timeOffset = 0;\n this.config = void 0;\n this.videoTrack = void 0;\n this.audioTrack = void 0;\n this.id3Track = void 0;\n this.txtTrack = void 0;\n this.config = config;\n }\n var _proto = MP4Demuxer.prototype;\n _proto.resetTimeStamp = function resetTimeStamp() {};\n _proto.resetInitSegment = function resetInitSegment(initSegment, audioCodec, videoCodec, trackDuration) {\n var videoTrack = this.videoTrack = (0,_dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__.dummyTrack)('video', 1);\n var audioTrack = this.audioTrack = (0,_dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__.dummyTrack)('audio', 1);\n var captionTrack = this.txtTrack = (0,_dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__.dummyTrack)('text', 1);\n this.id3Track = (0,_dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__.dummyTrack)('id3', 1);\n this.timeOffset = 0;\n if (!initSegment || !initSegment.byteLength) {\n return;\n }\n var initData = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.parseInitSegment)(initSegment);\n if (initData.video) {\n var _initData$video = initData.video,\n id = _initData$video.id,\n timescale = _initData$video.timescale,\n codec = _initData$video.codec;\n videoTrack.id = id;\n videoTrack.timescale = captionTrack.timescale = timescale;\n videoTrack.codec = codec;\n }\n if (initData.audio) {\n var _initData$audio = initData.audio,\n _id = _initData$audio.id,\n _timescale = _initData$audio.timescale,\n _codec = _initData$audio.codec;\n audioTrack.id = _id;\n audioTrack.timescale = _timescale;\n audioTrack.codec = _codec;\n }\n captionTrack.id = _utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.RemuxerTrackIdConfig.text;\n videoTrack.sampleDuration = 0;\n videoTrack.duration = audioTrack.duration = trackDuration;\n };\n _proto.resetContiguity = function resetContiguity() {};\n MP4Demuxer.probe = function probe(data) {\n // ensure we find a moof box in the first 16 kB\n data = data.length > 16384 ? data.subarray(0, 16384) : data;\n return (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.findBox)(data, ['moof']).length > 0;\n };\n _proto.demux = function demux(data, timeOffset) {\n this.timeOffset = timeOffset;\n // Load all data into the avc track. The CMAF remuxer will look for the data in the samples object; the rest of the fields do not matter\n var videoSamples = data;\n var videoTrack = this.videoTrack;\n var textTrack = this.txtTrack;\n if (this.config.progressive) {\n // Split the bytestream into two ranges: one encompassing all data up until the start of the last moof, and everything else.\n // This is done to guarantee that we're sending valid data to MSE - when demuxing progressively, we have no guarantee\n // that the fetch loader gives us flush moof+mdat pairs. If we push jagged data to MSE, it will throw an exception.\n if (this.remainderData) {\n videoSamples = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.appendUint8Array)(this.remainderData, data);\n }\n var segmentedData = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.segmentValidRange)(videoSamples);\n this.remainderData = segmentedData.remainder;\n videoTrack.samples = segmentedData.valid || new Uint8Array();\n } else {\n videoTrack.samples = videoSamples;\n }\n var id3Track = this.extractID3Track(videoTrack, timeOffset);\n textTrack.samples = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.parseSamples)(timeOffset, videoTrack);\n return {\n videoTrack: videoTrack,\n audioTrack: this.audioTrack,\n id3Track: id3Track,\n textTrack: this.txtTrack\n };\n };\n _proto.flush = function flush() {\n var timeOffset = this.timeOffset;\n var videoTrack = this.videoTrack;\n var textTrack = this.txtTrack;\n videoTrack.samples = this.remainderData || new Uint8Array();\n this.remainderData = null;\n var id3Track = this.extractID3Track(videoTrack, this.timeOffset);\n textTrack.samples = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.parseSamples)(timeOffset, videoTrack);\n return {\n videoTrack: videoTrack,\n audioTrack: (0,_dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__.dummyTrack)(),\n id3Track: id3Track,\n textTrack: (0,_dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__.dummyTrack)()\n };\n };\n _proto.extractID3Track = function extractID3Track(videoTrack, timeOffset) {\n var id3Track = this.id3Track;\n if (videoTrack.samples.length) {\n var emsgs = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.findBox)(videoTrack.samples, ['emsg']);\n if (emsgs) {\n emsgs.forEach(function (data) {\n var emsgInfo = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.parseEmsg)(data);\n if (emsgSchemePattern.test(emsgInfo.schemeIdUri)) {\n var pts = (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(emsgInfo.presentationTime) ? emsgInfo.presentationTime / emsgInfo.timeScale : timeOffset + emsgInfo.presentationTimeDelta / emsgInfo.timeScale;\n var duration = emsgInfo.eventDuration === 0xffffffff ? Number.POSITIVE_INFINITY : emsgInfo.eventDuration / emsgInfo.timeScale;\n // Safari takes anything <= 0.001 seconds and maps it to Infinity\n if (duration <= 0.001) {\n duration = Number.POSITIVE_INFINITY;\n }\n var payload = emsgInfo.payload;\n id3Track.samples.push({\n data: payload,\n len: payload.byteLength,\n dts: pts,\n pts: pts,\n type: _types_demuxer__WEBPACK_IMPORTED_MODULE_1__.MetadataSchema.emsg,\n duration: duration\n });\n }\n });\n }\n }\n return id3Track;\n };\n _proto.demuxSampleAes = function demuxSampleAes(data, keyData, timeOffset) {\n return Promise.reject(new Error('The MP4 demuxer does not support SAMPLE-AES decryption'));\n };\n _proto.destroy = function destroy() {};\n return MP4Demuxer;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MP4Demuxer);\n\n/***/ }),\n\n/***/ \"./src/demux/mpegaudio.ts\":\n/*!********************************!*\\\n !*** ./src/demux/mpegaudio.ts ***!\n \\********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"appendFrame\": () => (/* binding */ appendFrame),\n/* harmony export */ \"canParse\": () => (/* binding */ canParse),\n/* harmony export */ \"isHeader\": () => (/* binding */ isHeader),\n/* harmony export */ \"isHeaderPattern\": () => (/* binding */ isHeaderPattern),\n/* harmony export */ \"parseHeader\": () => (/* binding */ parseHeader),\n/* harmony export */ \"probe\": () => (/* binding */ probe)\n/* harmony export */ });\n/**\n * MPEG parser helper\n */\n\nvar chromeVersion = null;\nvar BitratesMap = [32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160];\nvar SamplingRateMap = [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000];\nvar SamplesCoefficients = [\n// MPEG 2.5\n[0,\n// Reserved\n72,\n// Layer3\n144,\n// Layer2\n12 // Layer1\n],\n// Reserved\n[0,\n// Reserved\n0,\n// Layer3\n0,\n// Layer2\n0 // Layer1\n],\n// MPEG 2\n[0,\n// Reserved\n72,\n// Layer3\n144,\n// Layer2\n12 // Layer1\n],\n// MPEG 1\n[0,\n// Reserved\n144,\n// Layer3\n144,\n// Layer2\n12 // Layer1\n]];\n\nvar BytesInSlot = [0,\n// Reserved\n1,\n// Layer3\n1,\n// Layer2\n4 // Layer1\n];\n\nfunction appendFrame(track, data, offset, pts, frameIndex) {\n // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference\n if (offset + 24 > data.length) {\n return;\n }\n var header = parseHeader(data, offset);\n if (header && offset + header.frameLength <= data.length) {\n var frameDuration = header.samplesPerFrame * 90000 / header.sampleRate;\n var stamp = pts + frameIndex * frameDuration;\n var sample = {\n unit: data.subarray(offset, offset + header.frameLength),\n pts: stamp,\n dts: stamp\n };\n track.config = [];\n track.channelCount = header.channelCount;\n track.samplerate = header.sampleRate;\n track.samples.push(sample);\n return {\n sample: sample,\n length: header.frameLength,\n missing: 0\n };\n }\n}\nfunction parseHeader(data, offset) {\n var mpegVersion = data[offset + 1] >> 3 & 3;\n var mpegLayer = data[offset + 1] >> 1 & 3;\n var bitRateIndex = data[offset + 2] >> 4 & 15;\n var sampleRateIndex = data[offset + 2] >> 2 & 3;\n if (mpegVersion !== 1 && bitRateIndex !== 0 && bitRateIndex !== 15 && sampleRateIndex !== 3) {\n var paddingBit = data[offset + 2] >> 1 & 1;\n var channelMode = data[offset + 3] >> 6;\n var columnInBitrates = mpegVersion === 3 ? 3 - mpegLayer : mpegLayer === 3 ? 3 : 4;\n var bitRate = BitratesMap[columnInBitrates * 14 + bitRateIndex - 1] * 1000;\n var columnInSampleRates = mpegVersion === 3 ? 0 : mpegVersion === 2 ? 1 : 2;\n var sampleRate = SamplingRateMap[columnInSampleRates * 3 + sampleRateIndex];\n var channelCount = channelMode === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)\n var sampleCoefficient = SamplesCoefficients[mpegVersion][mpegLayer];\n var bytesInSlot = BytesInSlot[mpegLayer];\n var samplesPerFrame = sampleCoefficient * 8 * bytesInSlot;\n var frameLength = Math.floor(sampleCoefficient * bitRate / sampleRate + paddingBit) * bytesInSlot;\n if (chromeVersion === null) {\n var userAgent = navigator.userAgent || '';\n var result = userAgent.match(/Chrome\\/(\\d+)/i);\n chromeVersion = result ? parseInt(result[1]) : 0;\n }\n var needChromeFix = !!chromeVersion && chromeVersion <= 87;\n if (needChromeFix && mpegLayer === 2 && bitRate >= 224000 && channelMode === 0) {\n // Work around bug in Chromium by setting channelMode to dual-channel (01) instead of stereo (00)\n data[offset + 3] = data[offset + 3] | 0x80;\n }\n return {\n sampleRate: sampleRate,\n channelCount: channelCount,\n frameLength: frameLength,\n samplesPerFrame: samplesPerFrame\n };\n }\n}\nfunction isHeaderPattern(data, offset) {\n return data[offset] === 0xff && (data[offset + 1] & 0xe0) === 0xe0 && (data[offset + 1] & 0x06) !== 0x00;\n}\nfunction isHeader(data, offset) {\n // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1\n // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)\n // More info http://www.mp3-tech.org/programmer/frame_header.html\n return offset + 1 < data.length && isHeaderPattern(data, offset);\n}\nfunction canParse(data, offset) {\n var headerSize = 4;\n return isHeaderPattern(data, offset) && headerSize <= data.length - offset;\n}\nfunction probe(data, offset) {\n // same as isHeader but we also check that MPEG frame follows last MPEG frame\n // or end of data is reached\n if (offset + 1 < data.length && isHeaderPattern(data, offset)) {\n // MPEG header Length\n var headerLength = 4;\n // MPEG frame Length\n var header = parseHeader(data, offset);\n var frameLength = headerLength;\n if (header !== null && header !== void 0 && header.frameLength) {\n frameLength = header.frameLength;\n }\n var newOffset = offset + frameLength;\n return newOffset === data.length || isHeader(data, newOffset);\n }\n return false;\n}\n\n/***/ }),\n\n/***/ \"./src/demux/sample-aes.ts\":\n/*!*********************************!*\\\n !*** ./src/demux/sample-aes.ts ***!\n \\*********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _crypt_decrypter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../crypt/decrypter */ \"./src/crypt/decrypter.ts\");\n/* harmony import */ var _utils_mp4_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/mp4-tools */ \"./src/utils/mp4-tools.ts\");\n/**\n * SAMPLE-AES decrypter\n */\n\n\n\nvar SampleAesDecrypter = /*#__PURE__*/function () {\n function SampleAesDecrypter(observer, config, keyData) {\n this.keyData = void 0;\n this.decrypter = void 0;\n this.keyData = keyData;\n this.decrypter = new _crypt_decrypter__WEBPACK_IMPORTED_MODULE_0__[\"default\"](config, {\n removePKCS7Padding: false\n });\n }\n var _proto = SampleAesDecrypter.prototype;\n _proto.decryptBuffer = function decryptBuffer(encryptedData) {\n return this.decrypter.decrypt(encryptedData, this.keyData.key.buffer, this.keyData.iv.buffer);\n }\n\n // AAC - encrypt all full 16 bytes blocks starting from offset 16\n ;\n _proto.decryptAacSample = function decryptAacSample(samples, sampleIndex, callback) {\n var _this = this;\n var curUnit = samples[sampleIndex].unit;\n if (curUnit.length <= 16) {\n // No encrypted portion in this sample (first 16 bytes is not\n // encrypted, see https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption/Encryption/Encryption.html),\n return;\n }\n var encryptedData = curUnit.subarray(16, curUnit.length - curUnit.length % 16);\n var encryptedBuffer = encryptedData.buffer.slice(encryptedData.byteOffset, encryptedData.byteOffset + encryptedData.length);\n this.decryptBuffer(encryptedBuffer).then(function (decryptedBuffer) {\n var decryptedData = new Uint8Array(decryptedBuffer);\n curUnit.set(decryptedData, 16);\n if (!_this.decrypter.isSync()) {\n _this.decryptAacSamples(samples, sampleIndex + 1, callback);\n }\n });\n };\n _proto.decryptAacSamples = function decryptAacSamples(samples, sampleIndex, callback) {\n for (;; sampleIndex++) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n if (samples[sampleIndex].unit.length < 32) {\n continue;\n }\n this.decryptAacSample(samples, sampleIndex, callback);\n if (!this.decrypter.isSync()) {\n return;\n }\n }\n }\n\n // AVC - encrypt one 16 bytes block out of ten, starting from offset 32\n ;\n _proto.getAvcEncryptedData = function getAvcEncryptedData(decodedData) {\n var encryptedDataLen = Math.floor((decodedData.length - 48) / 160) * 16 + 16;\n var encryptedData = new Int8Array(encryptedDataLen);\n var outputPos = 0;\n for (var inputPos = 32; inputPos < decodedData.length - 16; inputPos += 160, outputPos += 16) {\n encryptedData.set(decodedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return encryptedData;\n };\n _proto.getAvcDecryptedUnit = function getAvcDecryptedUnit(decodedData, decryptedData) {\n var uint8DecryptedData = new Uint8Array(decryptedData);\n var inputPos = 0;\n for (var outputPos = 32; outputPos < decodedData.length - 16; outputPos += 160, inputPos += 16) {\n decodedData.set(uint8DecryptedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return decodedData;\n };\n _proto.decryptAvcSample = function decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit) {\n var _this2 = this;\n var decodedData = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_1__.discardEPB)(curUnit.data);\n var encryptedData = this.getAvcEncryptedData(decodedData);\n this.decryptBuffer(encryptedData.buffer).then(function (decryptedBuffer) {\n curUnit.data = _this2.getAvcDecryptedUnit(decodedData, decryptedBuffer);\n if (!_this2.decrypter.isSync()) {\n _this2.decryptAvcSamples(samples, sampleIndex, unitIndex + 1, callback);\n }\n });\n };\n _proto.decryptAvcSamples = function decryptAvcSamples(samples, sampleIndex, unitIndex, callback) {\n if (samples instanceof Uint8Array) {\n throw new Error('Cannot decrypt samples of type Uint8Array');\n }\n for (;; sampleIndex++, unitIndex = 0) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n var curUnits = samples[sampleIndex].units;\n for (;; unitIndex++) {\n if (unitIndex >= curUnits.length) {\n break;\n }\n var curUnit = curUnits[unitIndex];\n if (curUnit.data.length <= 48 || curUnit.type !== 1 && curUnit.type !== 5) {\n continue;\n }\n this.decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit);\n if (!this.decrypter.isSync()) {\n return;\n }\n }\n }\n };\n return SampleAesDecrypter;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SampleAesDecrypter);\n\n/***/ }),\n\n/***/ \"./src/demux/transmuxer-interface.ts\":\n/*!*******************************************!*\\\n !*** ./src/demux/transmuxer-interface.ts ***!\n \\*******************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ TransmuxerInterface)\n/* harmony export */ });\n/* harmony import */ var _webworkify_webpack__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./webworkify-webpack */ \"./src/demux/webworkify-webpack.js\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _demux_transmuxer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../demux/transmuxer */ \"./src/demux/transmuxer.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _utils_mediasource_helper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/mediasource-helper */ \"./src/utils/mediasource-helper.ts\");\n/* harmony import */ var eventemitter3__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\n/* harmony import */ var eventemitter3__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(eventemitter3__WEBPACK_IMPORTED_MODULE_6__);\n\n\n\n\n\n\n\nvar MediaSource = (0,_utils_mediasource_helper__WEBPACK_IMPORTED_MODULE_5__.getMediaSource)() || {\n isTypeSupported: function isTypeSupported() {\n return false;\n }\n};\nvar TransmuxerInterface = /*#__PURE__*/function () {\n function TransmuxerInterface(hls, id, onTransmuxComplete, onFlush) {\n var _this = this;\n this.hls = void 0;\n this.id = void 0;\n this.observer = void 0;\n this.frag = null;\n this.part = null;\n this.useWorker = void 0;\n this.worker = void 0;\n this.onwmsg = void 0;\n this.transmuxer = null;\n this.onTransmuxComplete = void 0;\n this.onFlush = void 0;\n var config = hls.config;\n this.hls = hls;\n this.id = id;\n this.useWorker = !!config.enableWorker;\n this.onTransmuxComplete = onTransmuxComplete;\n this.onFlush = onFlush;\n var forwardMessage = function forwardMessage(ev, data) {\n data = data || {};\n data.frag = _this.frag;\n data.id = _this.id;\n _this.hls.trigger(ev, data);\n };\n\n // forward events to main thread\n this.observer = new eventemitter3__WEBPACK_IMPORTED_MODULE_6__.EventEmitter();\n this.observer.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.FRAG_DECRYPTED, forwardMessage);\n this.observer.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, forwardMessage);\n var typeSupported = {\n mp4: MediaSource.isTypeSupported('video/mp4'),\n mpeg: MediaSource.isTypeSupported('audio/mpeg'),\n mp3: MediaSource.isTypeSupported('audio/mp4; codecs=\"mp3\"')\n };\n // navigator.vendor is not always available in Web Worker\n // refer to https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/navigator\n var vendor = navigator.vendor;\n if (this.useWorker && typeof Worker !== 'undefined') {\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.log('demuxing in webworker');\n var worker;\n try {\n worker = this.worker = (0,_webworkify_webpack__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(/*require.resolve*/(/*! ../demux/transmuxer-worker.ts */ \"./src/demux/transmuxer-worker.ts\"));\n this.onwmsg = this.onWorkerMessage.bind(this);\n worker.addEventListener('message', this.onwmsg);\n worker.onerror = function (event) {\n _this.useWorker = false;\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.warn('Exception in webworker, fallback to inline');\n _this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_4__.ErrorTypes.OTHER_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_4__.ErrorDetails.INTERNAL_EXCEPTION,\n fatal: false,\n event: 'demuxerWorker',\n error: new Error(event.message + \" (\" + event.filename + \":\" + event.lineno + \")\")\n });\n };\n worker.postMessage({\n cmd: 'init',\n typeSupported: typeSupported,\n vendor: vendor,\n id: id,\n config: JSON.stringify(config)\n });\n } catch (err) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.warn('Error in worker:', err);\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.error('Error while initializing DemuxerWorker, fallback to inline');\n if (worker) {\n // revoke the Object URL that was used to create transmuxer worker, so as not to leak it\n self.URL.revokeObjectURL(worker.objectURL);\n }\n this.transmuxer = new _demux_transmuxer__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.observer, typeSupported, config, vendor, id);\n this.worker = null;\n }\n } else {\n this.transmuxer = new _demux_transmuxer__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.observer, typeSupported, config, vendor, id);\n }\n }\n var _proto = TransmuxerInterface.prototype;\n _proto.destroy = function destroy() {\n var w = this.worker;\n if (w) {\n w.removeEventListener('message', this.onwmsg);\n w.terminate();\n this.worker = null;\n this.onwmsg = undefined;\n } else {\n var transmuxer = this.transmuxer;\n if (transmuxer) {\n transmuxer.destroy();\n this.transmuxer = null;\n }\n }\n var observer = this.observer;\n if (observer) {\n observer.removeAllListeners();\n }\n this.frag = null;\n // @ts-ignore\n this.observer = null;\n // @ts-ignore\n this.hls = null;\n };\n _proto.push = function push(data, initSegmentData, audioCodec, videoCodec, frag, part, duration, accurateTimeOffset, chunkMeta, defaultInitPTS) {\n var _frag$initSegment,\n _lastFrag$initSegment,\n _this2 = this;\n chunkMeta.transmuxing.start = self.performance.now();\n var transmuxer = this.transmuxer,\n worker = this.worker;\n var timeOffset = part ? part.start : frag.start;\n // TODO: push \"clear-lead\" decrypt data for unencrypted fragments in streams with encrypted ones\n var decryptdata = frag.decryptdata;\n var lastFrag = this.frag;\n var discontinuity = !(lastFrag && frag.cc === lastFrag.cc);\n var trackSwitch = !(lastFrag && chunkMeta.level === lastFrag.level);\n var snDiff = lastFrag ? chunkMeta.sn - lastFrag.sn : -1;\n var partDiff = this.part ? chunkMeta.part - this.part.index : -1;\n var progressive = snDiff === 0 && chunkMeta.id > 1 && chunkMeta.id === (lastFrag === null || lastFrag === void 0 ? void 0 : lastFrag.stats.chunkCount);\n var contiguous = !trackSwitch && (snDiff === 1 || snDiff === 0 && (partDiff === 1 || progressive && partDiff <= 0));\n var now = self.performance.now();\n if (trackSwitch || snDiff || frag.stats.parsing.start === 0) {\n frag.stats.parsing.start = now;\n }\n if (part && (partDiff || !contiguous)) {\n part.stats.parsing.start = now;\n }\n var initSegmentChange = !(lastFrag && ((_frag$initSegment = frag.initSegment) === null || _frag$initSegment === void 0 ? void 0 : _frag$initSegment.url) === ((_lastFrag$initSegment = lastFrag.initSegment) === null || _lastFrag$initSegment === void 0 ? void 0 : _lastFrag$initSegment.url));\n var state = new _demux_transmuxer__WEBPACK_IMPORTED_MODULE_2__.TransmuxState(discontinuity, contiguous, accurateTimeOffset, trackSwitch, timeOffset, initSegmentChange);\n if (!contiguous || discontinuity || initSegmentChange) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.log(\"[transmuxer-interface, \" + frag.type + \"]: Starting new transmux session for sn: \" + chunkMeta.sn + \" p: \" + chunkMeta.part + \" level: \" + chunkMeta.level + \" id: \" + chunkMeta.id + \"\\n discontinuity: \" + discontinuity + \"\\n trackSwitch: \" + trackSwitch + \"\\n contiguous: \" + contiguous + \"\\n accurateTimeOffset: \" + accurateTimeOffset + \"\\n timeOffset: \" + timeOffset + \"\\n initSegmentChange: \" + initSegmentChange);\n var config = new _demux_transmuxer__WEBPACK_IMPORTED_MODULE_2__.TransmuxConfig(audioCodec, videoCodec, initSegmentData, duration, defaultInitPTS);\n this.configureTransmuxer(config);\n }\n this.frag = frag;\n this.part = part;\n\n // Frags with sn of 'initSegment' are not transmuxed\n if (worker) {\n // post fragment payload as transferable objects for ArrayBuffer (no copy)\n worker.postMessage({\n cmd: 'demux',\n data: data,\n decryptdata: decryptdata,\n chunkMeta: chunkMeta,\n state: state\n }, data instanceof ArrayBuffer ? [data] : []);\n } else if (transmuxer) {\n var _transmuxResult = transmuxer.push(data, decryptdata, chunkMeta, state);\n if ((0,_demux_transmuxer__WEBPACK_IMPORTED_MODULE_2__.isPromise)(_transmuxResult)) {\n transmuxer.async = true;\n _transmuxResult.then(function (data) {\n _this2.handleTransmuxComplete(data);\n }).catch(function (error) {\n _this2.transmuxerError(error, chunkMeta, 'transmuxer-interface push error');\n });\n } else {\n transmuxer.async = false;\n this.handleTransmuxComplete(_transmuxResult);\n }\n }\n };\n _proto.flush = function flush(chunkMeta) {\n var _this3 = this;\n chunkMeta.transmuxing.start = self.performance.now();\n var transmuxer = this.transmuxer,\n worker = this.worker;\n if (worker) {\n 1;\n worker.postMessage({\n cmd: 'flush',\n chunkMeta: chunkMeta\n });\n } else if (transmuxer) {\n var _transmuxResult2 = transmuxer.flush(chunkMeta);\n var asyncFlush = (0,_demux_transmuxer__WEBPACK_IMPORTED_MODULE_2__.isPromise)(_transmuxResult2);\n if (asyncFlush || transmuxer.async) {\n if (!(0,_demux_transmuxer__WEBPACK_IMPORTED_MODULE_2__.isPromise)(_transmuxResult2)) {\n _transmuxResult2 = Promise.resolve(_transmuxResult2);\n }\n _transmuxResult2.then(function (data) {\n _this3.handleFlushResult(data, chunkMeta);\n }).catch(function (error) {\n _this3.transmuxerError(error, chunkMeta, 'transmuxer-interface flush error');\n });\n } else {\n this.handleFlushResult(_transmuxResult2, chunkMeta);\n }\n }\n };\n _proto.transmuxerError = function transmuxerError(error, chunkMeta, reason) {\n if (!this.hls) {\n return;\n }\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_4__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_4__.ErrorDetails.FRAG_PARSING_ERROR,\n chunkMeta: chunkMeta,\n fatal: false,\n error: error,\n err: error,\n reason: reason\n });\n };\n _proto.handleFlushResult = function handleFlushResult(results, chunkMeta) {\n var _this4 = this;\n results.forEach(function (result) {\n _this4.handleTransmuxComplete(result);\n });\n this.onFlush(chunkMeta);\n };\n _proto.onWorkerMessage = function onWorkerMessage(ev) {\n var data = ev.data;\n var hls = this.hls;\n switch (data.event) {\n case 'init':\n {\n // revoke the Object URL that was used to create transmuxer worker, so as not to leak it\n self.URL.revokeObjectURL(this.worker.objectURL);\n break;\n }\n case 'transmuxComplete':\n {\n this.handleTransmuxComplete(data.data);\n break;\n }\n case 'flush':\n {\n this.onFlush(data.data);\n break;\n }\n\n // pass logs from the worker thread to the main logger\n case 'workerLog':\n if (_utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger[data.data.logType]) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger[data.data.logType](data.data.message);\n }\n break;\n default:\n {\n data.data = data.data || {};\n data.data.frag = this.frag;\n data.data.id = this.id;\n hls.trigger(data.event, data.data);\n break;\n }\n }\n };\n _proto.configureTransmuxer = function configureTransmuxer(config) {\n var worker = this.worker,\n transmuxer = this.transmuxer;\n if (worker) {\n worker.postMessage({\n cmd: 'configure',\n config: config\n });\n } else if (transmuxer) {\n transmuxer.configure(config);\n }\n };\n _proto.handleTransmuxComplete = function handleTransmuxComplete(result) {\n result.chunkMeta.transmuxing.end = self.performance.now();\n this.onTransmuxComplete(result);\n };\n return TransmuxerInterface;\n}();\n\n\n/***/ }),\n\n/***/ \"./src/demux/transmuxer-worker.ts\":\n/*!****************************************!*\\\n !*** ./src/demux/transmuxer-worker.ts ***!\n \\****************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ TransmuxerWorker)\n/* harmony export */ });\n/* harmony import */ var _demux_transmuxer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../demux/transmuxer */ \"./src/demux/transmuxer.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var eventemitter3__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\n/* harmony import */ var eventemitter3__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(eventemitter3__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n\n\n\n\n\nfunction TransmuxerWorker(self) {\n var observer = new eventemitter3__WEBPACK_IMPORTED_MODULE_3__.EventEmitter();\n var forwardMessage = function forwardMessage(ev, data) {\n self.postMessage({\n event: ev,\n data: data\n });\n };\n\n // forward events to main thread\n observer.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.FRAG_DECRYPTED, forwardMessage);\n observer.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, forwardMessage);\n\n // forward logger events to main thread\n var forwardWorkerLogs = function forwardWorkerLogs() {\n var _loop = function _loop(logFn) {\n var func = function func(message) {\n forwardMessage('workerLog', {\n logType: logFn,\n message: message\n });\n };\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger[logFn] = func;\n };\n for (var logFn in _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger) {\n _loop(logFn);\n }\n };\n self.addEventListener('message', function (ev) {\n var data = ev.data;\n switch (data.cmd) {\n case 'init':\n {\n var config = JSON.parse(data.config);\n self.transmuxer = new _demux_transmuxer__WEBPACK_IMPORTED_MODULE_0__[\"default\"](observer, data.typeSupported, config, data.vendor, data.id);\n (0,_utils_logger__WEBPACK_IMPORTED_MODULE_2__.enableLogs)(config.debug, data.id);\n forwardWorkerLogs();\n forwardMessage('init', null);\n break;\n }\n case 'configure':\n {\n self.transmuxer.configure(data.config);\n break;\n }\n case 'demux':\n {\n var transmuxResult = self.transmuxer.push(data.data, data.decryptdata, data.chunkMeta, data.state);\n if ((0,_demux_transmuxer__WEBPACK_IMPORTED_MODULE_0__.isPromise)(transmuxResult)) {\n self.transmuxer.async = true;\n transmuxResult.then(function (data) {\n emitTransmuxComplete(self, data);\n }).catch(function (error) {\n forwardMessage(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_4__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_4__.ErrorDetails.FRAG_PARSING_ERROR,\n chunkMeta: data.chunkMeta,\n fatal: false,\n error: error,\n err: error,\n reason: \"transmuxer-worker push error\"\n });\n });\n } else {\n self.transmuxer.async = false;\n emitTransmuxComplete(self, transmuxResult);\n }\n break;\n }\n case 'flush':\n {\n var id = data.chunkMeta;\n var _transmuxResult = self.transmuxer.flush(id);\n var asyncFlush = (0,_demux_transmuxer__WEBPACK_IMPORTED_MODULE_0__.isPromise)(_transmuxResult);\n if (asyncFlush || self.transmuxer.async) {\n if (!(0,_demux_transmuxer__WEBPACK_IMPORTED_MODULE_0__.isPromise)(_transmuxResult)) {\n _transmuxResult = Promise.resolve(_transmuxResult);\n }\n _transmuxResult.then(function (results) {\n handleFlushResult(self, results, id);\n }).catch(function (error) {\n forwardMessage(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_4__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_4__.ErrorDetails.FRAG_PARSING_ERROR,\n chunkMeta: data.chunkMeta,\n fatal: false,\n error: error,\n err: error,\n reason: \"transmuxer-worker flush error\"\n });\n });\n } else {\n handleFlushResult(self, _transmuxResult, id);\n }\n break;\n }\n default:\n break;\n }\n });\n}\nfunction emitTransmuxComplete(self, transmuxResult) {\n if (isEmptyResult(transmuxResult.remuxResult)) {\n return false;\n }\n var transferable = [];\n var _transmuxResult$remux = transmuxResult.remuxResult,\n audio = _transmuxResult$remux.audio,\n video = _transmuxResult$remux.video;\n if (audio) {\n addToTransferable(transferable, audio);\n }\n if (video) {\n addToTransferable(transferable, video);\n }\n self.postMessage({\n event: 'transmuxComplete',\n data: transmuxResult\n }, transferable);\n return true;\n}\n\n// Converts data to a transferable object https://developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast)\n// in order to minimize message passing overhead\nfunction addToTransferable(transferable, track) {\n if (track.data1) {\n transferable.push(track.data1.buffer);\n }\n if (track.data2) {\n transferable.push(track.data2.buffer);\n }\n}\nfunction handleFlushResult(self, results, chunkMeta) {\n var parsed = results.reduce(function (parsed, result) {\n return emitTransmuxComplete(self, result) || parsed;\n }, false);\n if (!parsed) {\n // Emit at least one \"transmuxComplete\" message even if media is not found to update stream-controller state to PARSING\n self.postMessage({\n event: 'transmuxComplete',\n data: results[0]\n });\n }\n self.postMessage({\n event: 'flush',\n data: chunkMeta\n });\n}\nfunction isEmptyResult(remuxResult) {\n return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;\n}\n\n/***/ }),\n\n/***/ \"./src/demux/transmuxer.ts\":\n/*!*********************************!*\\\n !*** ./src/demux/transmuxer.ts ***!\n \\*********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TransmuxConfig\": () => (/* binding */ TransmuxConfig),\n/* harmony export */ \"TransmuxState\": () => (/* binding */ TransmuxState),\n/* harmony export */ \"default\": () => (/* binding */ Transmuxer),\n/* harmony export */ \"isPromise\": () => (/* binding */ isPromise)\n/* harmony export */ });\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _crypt_decrypter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../crypt/decrypter */ \"./src/crypt/decrypter.ts\");\n/* harmony import */ var _demux_aacdemuxer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../demux/aacdemuxer */ \"./src/demux/aacdemuxer.ts\");\n/* harmony import */ var _demux_mp4demuxer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../demux/mp4demuxer */ \"./src/demux/mp4demuxer.ts\");\n/* harmony import */ var _demux_tsdemuxer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../demux/tsdemuxer */ \"./src/demux/tsdemuxer.ts\");\n/* harmony import */ var _demux_mp3demuxer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../demux/mp3demuxer */ \"./src/demux/mp3demuxer.ts\");\n/* harmony import */ var _remux_mp4_remuxer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../remux/mp4-remuxer */ \"./src/remux/mp4-remuxer.ts\");\n/* harmony import */ var _remux_passthrough_remuxer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../remux/passthrough-remuxer */ \"./src/remux/passthrough-remuxer.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n\n\n\n\n\n\n\n\n\n\nvar now;\n// performance.now() not available on WebWorker, at least on Safari Desktop\ntry {\n now = self.performance.now.bind(self.performance);\n} catch (err) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.debug('Unable to use Performance API on this environment');\n now = self.Date.now;\n}\nvar muxConfig = [{\n demux: _demux_mp4demuxer__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n remux: _remux_passthrough_remuxer__WEBPACK_IMPORTED_MODULE_8__[\"default\"]\n}, {\n demux: _demux_tsdemuxer__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n remux: _remux_mp4_remuxer__WEBPACK_IMPORTED_MODULE_7__[\"default\"]\n}, {\n demux: _demux_aacdemuxer__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n remux: _remux_mp4_remuxer__WEBPACK_IMPORTED_MODULE_7__[\"default\"]\n}, {\n demux: _demux_mp3demuxer__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n remux: _remux_mp4_remuxer__WEBPACK_IMPORTED_MODULE_7__[\"default\"]\n}];\nvar Transmuxer = /*#__PURE__*/function () {\n function Transmuxer(observer, typeSupported, config, vendor, id) {\n this.async = false;\n this.observer = void 0;\n this.typeSupported = void 0;\n this.config = void 0;\n this.vendor = void 0;\n this.id = void 0;\n this.demuxer = void 0;\n this.remuxer = void 0;\n this.decrypter = void 0;\n this.probe = void 0;\n this.decryptionPromise = null;\n this.transmuxConfig = void 0;\n this.currentTransmuxState = void 0;\n this.observer = observer;\n this.typeSupported = typeSupported;\n this.config = config;\n this.vendor = vendor;\n this.id = id;\n }\n var _proto = Transmuxer.prototype;\n _proto.configure = function configure(transmuxConfig) {\n this.transmuxConfig = transmuxConfig;\n if (this.decrypter) {\n this.decrypter.reset();\n }\n };\n _proto.push = function push(data, decryptdata, chunkMeta, state) {\n var _this = this;\n var stats = chunkMeta.transmuxing;\n stats.executeStart = now();\n var uintData = new Uint8Array(data);\n var currentTransmuxState = this.currentTransmuxState,\n transmuxConfig = this.transmuxConfig;\n if (state) {\n this.currentTransmuxState = state;\n }\n var _ref = state || currentTransmuxState,\n contiguous = _ref.contiguous,\n discontinuity = _ref.discontinuity,\n trackSwitch = _ref.trackSwitch,\n accurateTimeOffset = _ref.accurateTimeOffset,\n timeOffset = _ref.timeOffset,\n initSegmentChange = _ref.initSegmentChange;\n var audioCodec = transmuxConfig.audioCodec,\n videoCodec = transmuxConfig.videoCodec,\n defaultInitPts = transmuxConfig.defaultInitPts,\n duration = transmuxConfig.duration,\n initSegmentData = transmuxConfig.initSegmentData;\n var keyData = getEncryptionType(uintData, decryptdata);\n if (keyData && keyData.method === 'AES-128') {\n var decrypter = this.getDecrypter();\n // Software decryption is synchronous; webCrypto is not\n if (decrypter.isSync()) {\n // Software decryption is progressive. Progressive decryption may not return a result on each call. Any cached\n // data is handled in the flush() call\n var decryptedData = decrypter.softwareDecrypt(uintData, keyData.key.buffer, keyData.iv.buffer);\n // For Low-Latency HLS Parts, decrypt in place, since part parsing is expected on push progress\n var loadingParts = chunkMeta.part > -1;\n if (loadingParts) {\n decryptedData = decrypter.flush();\n }\n if (!decryptedData) {\n stats.executeEnd = now();\n return emptyResult(chunkMeta);\n }\n uintData = new Uint8Array(decryptedData);\n } else {\n this.decryptionPromise = decrypter.webCryptoDecrypt(uintData, keyData.key.buffer, keyData.iv.buffer).then(function (decryptedData) {\n // Calling push here is important; if flush() is called while this is still resolving, this ensures that\n // the decrypted data has been transmuxed\n var result = _this.push(decryptedData, null, chunkMeta);\n _this.decryptionPromise = null;\n return result;\n });\n return this.decryptionPromise;\n }\n }\n var resetMuxers = this.needsProbing(discontinuity, trackSwitch);\n if (resetMuxers) {\n this.configureTransmuxer(uintData);\n }\n if (discontinuity || trackSwitch || initSegmentChange || resetMuxers) {\n this.resetInitSegment(initSegmentData, audioCodec, videoCodec, duration, decryptdata);\n }\n if (discontinuity || initSegmentChange || resetMuxers) {\n this.resetInitialTimestamp(defaultInitPts);\n }\n if (!contiguous) {\n this.resetContiguity();\n }\n var result = this.transmux(uintData, keyData, timeOffset, accurateTimeOffset, chunkMeta);\n var currentState = this.currentTransmuxState;\n currentState.contiguous = true;\n currentState.discontinuity = false;\n currentState.trackSwitch = false;\n stats.executeEnd = now();\n return result;\n }\n\n // Due to data caching, flush calls can produce more than one TransmuxerResult (hence the Array type)\n ;\n _proto.flush = function flush(chunkMeta) {\n var _this2 = this;\n var stats = chunkMeta.transmuxing;\n stats.executeStart = now();\n var decrypter = this.decrypter,\n currentTransmuxState = this.currentTransmuxState,\n decryptionPromise = this.decryptionPromise;\n if (decryptionPromise) {\n // Upon resolution, the decryption promise calls push() and returns its TransmuxerResult up the stack. Therefore\n // only flushing is required for async decryption\n return decryptionPromise.then(function () {\n return _this2.flush(chunkMeta);\n });\n }\n var transmuxResults = [];\n var timeOffset = currentTransmuxState.timeOffset;\n if (decrypter) {\n // The decrypter may have data cached, which needs to be demuxed. In this case we'll have two TransmuxResults\n // This happens in the case that we receive only 1 push call for a segment (either for non-progressive downloads,\n // or for progressive downloads with small segments)\n var decryptedData = decrypter.flush();\n if (decryptedData) {\n // Push always returns a TransmuxerResult if decryptdata is null\n transmuxResults.push(this.push(decryptedData, null, chunkMeta));\n }\n }\n var demuxer = this.demuxer,\n remuxer = this.remuxer;\n if (!demuxer || !remuxer) {\n // If probing failed, then Hls.js has been given content its not able to handle\n this.observer.emit(_events__WEBPACK_IMPORTED_MODULE_0__.Events.ERROR, _events__WEBPACK_IMPORTED_MODULE_0__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.FRAG_PARSING_ERROR,\n fatal: true,\n reason: 'no demux matching with content found'\n });\n stats.executeEnd = now();\n return [emptyResult(chunkMeta)];\n }\n var demuxResultOrPromise = demuxer.flush(timeOffset);\n if (isPromise(demuxResultOrPromise)) {\n // Decrypt final SAMPLE-AES samples\n return demuxResultOrPromise.then(function (demuxResult) {\n _this2.flushRemux(transmuxResults, demuxResult, chunkMeta);\n return transmuxResults;\n });\n }\n this.flushRemux(transmuxResults, demuxResultOrPromise, chunkMeta);\n return transmuxResults;\n };\n _proto.flushRemux = function flushRemux(transmuxResults, demuxResult, chunkMeta) {\n var audioTrack = demuxResult.audioTrack,\n videoTrack = demuxResult.videoTrack,\n id3Track = demuxResult.id3Track,\n textTrack = demuxResult.textTrack;\n var _this$currentTransmux = this.currentTransmuxState,\n accurateTimeOffset = _this$currentTransmux.accurateTimeOffset,\n timeOffset = _this$currentTransmux.timeOffset;\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log(\"[transmuxer.ts]: Flushed fragment \" + chunkMeta.sn + (chunkMeta.part > -1 ? ' p: ' + chunkMeta.part : '') + \" of level \" + chunkMeta.level);\n var remuxResult = this.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, accurateTimeOffset, true, this.id);\n transmuxResults.push({\n remuxResult: remuxResult,\n chunkMeta: chunkMeta\n });\n chunkMeta.transmuxing.executeEnd = now();\n };\n _proto.resetInitialTimestamp = function resetInitialTimestamp(defaultInitPts) {\n var demuxer = this.demuxer,\n remuxer = this.remuxer;\n if (!demuxer || !remuxer) {\n return;\n }\n demuxer.resetTimeStamp(defaultInitPts);\n remuxer.resetTimeStamp(defaultInitPts);\n };\n _proto.resetContiguity = function resetContiguity() {\n var demuxer = this.demuxer,\n remuxer = this.remuxer;\n if (!demuxer || !remuxer) {\n return;\n }\n demuxer.resetContiguity();\n remuxer.resetNextTimestamp();\n };\n _proto.resetInitSegment = function resetInitSegment(initSegmentData, audioCodec, videoCodec, trackDuration, decryptdata) {\n var demuxer = this.demuxer,\n remuxer = this.remuxer;\n if (!demuxer || !remuxer) {\n return;\n }\n demuxer.resetInitSegment(initSegmentData, audioCodec, videoCodec, trackDuration);\n remuxer.resetInitSegment(initSegmentData, audioCodec, videoCodec, decryptdata);\n };\n _proto.destroy = function destroy() {\n if (this.demuxer) {\n this.demuxer.destroy();\n this.demuxer = undefined;\n }\n if (this.remuxer) {\n this.remuxer.destroy();\n this.remuxer = undefined;\n }\n };\n _proto.transmux = function transmux(data, keyData, timeOffset, accurateTimeOffset, chunkMeta) {\n var result;\n if (keyData && keyData.method === 'SAMPLE-AES') {\n result = this.transmuxSampleAes(data, keyData, timeOffset, accurateTimeOffset, chunkMeta);\n } else {\n result = this.transmuxUnencrypted(data, timeOffset, accurateTimeOffset, chunkMeta);\n }\n return result;\n };\n _proto.transmuxUnencrypted = function transmuxUnencrypted(data, timeOffset, accurateTimeOffset, chunkMeta) {\n var _demux = this.demuxer.demux(data, timeOffset, false, !this.config.progressive),\n audioTrack = _demux.audioTrack,\n videoTrack = _demux.videoTrack,\n id3Track = _demux.id3Track,\n textTrack = _demux.textTrack;\n var remuxResult = this.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, accurateTimeOffset, false, this.id);\n return {\n remuxResult: remuxResult,\n chunkMeta: chunkMeta\n };\n };\n _proto.transmuxSampleAes = function transmuxSampleAes(data, decryptData, timeOffset, accurateTimeOffset, chunkMeta) {\n var _this3 = this;\n return this.demuxer.demuxSampleAes(data, decryptData, timeOffset).then(function (demuxResult) {\n var remuxResult = _this3.remuxer.remux(demuxResult.audioTrack, demuxResult.videoTrack, demuxResult.id3Track, demuxResult.textTrack, timeOffset, accurateTimeOffset, false, _this3.id);\n return {\n remuxResult: remuxResult,\n chunkMeta: chunkMeta\n };\n });\n };\n _proto.configureTransmuxer = function configureTransmuxer(data) {\n var config = this.config,\n observer = this.observer,\n typeSupported = this.typeSupported,\n vendor = this.vendor;\n // probe for content type\n var mux;\n for (var i = 0, len = muxConfig.length; i < len; i++) {\n if (muxConfig[i].demux.probe(data)) {\n mux = muxConfig[i];\n break;\n }\n }\n if (!mux) {\n // If probing previous configs fail, use mp4 passthrough\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.warn('Failed to find demuxer by probing frag, treating as mp4 passthrough');\n mux = {\n demux: _demux_mp4demuxer__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n remux: _remux_passthrough_remuxer__WEBPACK_IMPORTED_MODULE_8__[\"default\"]\n };\n }\n // so let's check that current remuxer and demuxer are still valid\n var demuxer = this.demuxer;\n var remuxer = this.remuxer;\n var Remuxer = mux.remux;\n var Demuxer = mux.demux;\n if (!remuxer || !(remuxer instanceof Remuxer)) {\n this.remuxer = new Remuxer(observer, config, typeSupported, vendor);\n }\n if (!demuxer || !(demuxer instanceof Demuxer)) {\n this.demuxer = new Demuxer(observer, config, typeSupported);\n this.probe = Demuxer.probe;\n }\n };\n _proto.needsProbing = function needsProbing(discontinuity, trackSwitch) {\n // in case of continuity change, or track switch\n // we might switch from content type (AAC container to TS container, or TS to fmp4 for example)\n return !this.demuxer || !this.remuxer || discontinuity || trackSwitch;\n };\n _proto.getDecrypter = function getDecrypter() {\n var decrypter = this.decrypter;\n if (!decrypter) {\n decrypter = this.decrypter = new _crypt_decrypter__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.config);\n }\n return decrypter;\n };\n return Transmuxer;\n}();\n\nfunction getEncryptionType(data, decryptData) {\n var encryptionType = null;\n if (data.byteLength > 0 && decryptData != null && decryptData.key != null && decryptData.iv !== null && decryptData.method != null) {\n encryptionType = decryptData;\n }\n return encryptionType;\n}\nvar emptyResult = function emptyResult(chunkMeta) {\n return {\n remuxResult: {},\n chunkMeta: chunkMeta\n };\n};\nfunction isPromise(p) {\n return 'then' in p && p.then instanceof Function;\n}\nvar TransmuxConfig = function TransmuxConfig(audioCodec, videoCodec, initSegmentData, duration, defaultInitPts) {\n this.audioCodec = void 0;\n this.videoCodec = void 0;\n this.initSegmentData = void 0;\n this.duration = void 0;\n this.defaultInitPts = void 0;\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this.initSegmentData = initSegmentData;\n this.duration = duration;\n this.defaultInitPts = defaultInitPts;\n};\nvar TransmuxState = function TransmuxState(discontinuity, contiguous, accurateTimeOffset, trackSwitch, timeOffset, initSegmentChange) {\n this.discontinuity = void 0;\n this.contiguous = void 0;\n this.accurateTimeOffset = void 0;\n this.trackSwitch = void 0;\n this.timeOffset = void 0;\n this.initSegmentChange = void 0;\n this.discontinuity = discontinuity;\n this.contiguous = contiguous;\n this.accurateTimeOffset = accurateTimeOffset;\n this.trackSwitch = trackSwitch;\n this.timeOffset = timeOffset;\n this.initSegmentChange = initSegmentChange;\n};\n\n/***/ }),\n\n/***/ \"./src/demux/tsdemuxer.ts\":\n/*!********************************!*\\\n !*** ./src/demux/tsdemuxer.ts ***!\n \\********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _adts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adts */ \"./src/demux/adts.ts\");\n/* harmony import */ var _mpegaudio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mpegaudio */ \"./src/demux/mpegaudio.ts\");\n/* harmony import */ var _exp_golomb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./exp-golomb */ \"./src/demux/exp-golomb.ts\");\n/* harmony import */ var _sample_aes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./sample-aes */ \"./src/demux/sample-aes.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _utils_mp4_tools__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/mp4-tools */ \"./src/utils/mp4-tools.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _types_demuxer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../types/demuxer */ \"./src/types/demuxer.ts\");\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n/**\n * highly optimized TS demuxer:\n * parse PAT, PMT\n * extract PES packet from audio and video PIDs\n * extract AVC/H264 NAL units and AAC/ADTS samples from PES packet\n * trigger the remuxer upon parsing completion\n * it also tries to workaround as best as it can audio codec switch (HE-AAC to AAC and vice versa), without having to restart the MediaSource.\n * it also controls the remuxing process :\n * upon discontinuity or level switch detection, it will also notifies the remuxer so that it can reset its state.\n */\n\n\n\n\n\n\n\n\n\n\nvar PACKET_LENGTH = 188;\nvar TSDemuxer = /*#__PURE__*/function () {\n function TSDemuxer(observer, config, typeSupported) {\n this.observer = void 0;\n this.config = void 0;\n this.typeSupported = void 0;\n this.sampleAes = null;\n this.pmtParsed = false;\n this.audioCodec = void 0;\n this.videoCodec = void 0;\n this._duration = 0;\n this._pmtId = -1;\n this._avcTrack = void 0;\n this._audioTrack = void 0;\n this._id3Track = void 0;\n this._txtTrack = void 0;\n this.aacOverFlow = null;\n this.avcSample = null;\n this.remainderData = null;\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n }\n TSDemuxer.probe = function probe(data) {\n var syncOffset = TSDemuxer.syncOffset(data);\n if (syncOffset > 0) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.warn(\"MPEG2-TS detected but first sync word found @ offset \" + syncOffset);\n }\n return syncOffset !== -1;\n };\n TSDemuxer.syncOffset = function syncOffset(data) {\n var length = data.length;\n var scanwindow = Math.min(PACKET_LENGTH * 5, data.length - PACKET_LENGTH) + 1;\n var i = 0;\n while (i < scanwindow) {\n // a TS init segment should contain at least 2 TS packets: PAT and PMT, each starting with 0x47\n var foundPat = false;\n for (var j = i; j < length; j += PACKET_LENGTH) {\n if (data[j] === 0x47) {\n if (!foundPat && parsePID(data, j) === 0) {\n foundPat = true;\n }\n if (foundPat && j + PACKET_LENGTH > scanwindow) {\n return i;\n }\n } else {\n break;\n }\n }\n i++;\n }\n return -1;\n }\n\n /**\n * Creates a track model internal to demuxer used to drive remuxing input\n *\n * @param type 'audio' | 'video' | 'id3' | 'text'\n * @param duration\n * @return TSDemuxer's internal track model\n */;\n TSDemuxer.createTrack = function createTrack(type, duration) {\n return {\n container: type === 'video' || type === 'audio' ? 'video/mp2t' : undefined,\n type: type,\n id: _utils_mp4_tools__WEBPACK_IMPORTED_MODULE_5__.RemuxerTrackIdConfig[type],\n pid: -1,\n inputTimeScale: 90000,\n sequenceNumber: 0,\n samples: [],\n dropped: 0,\n duration: type === 'audio' ? duration : undefined\n };\n }\n\n /**\n * Initializes a new init segment on the demuxer/remuxer interface. Needed for discontinuities/track-switches (or at stream start)\n * Resets all internal track instances of the demuxer.\n */;\n var _proto = TSDemuxer.prototype;\n _proto.resetInitSegment = function resetInitSegment(initSegment, audioCodec, videoCodec, trackDuration) {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = TSDemuxer.createTrack('video');\n this._audioTrack = TSDemuxer.createTrack('audio', trackDuration);\n this._id3Track = TSDemuxer.createTrack('id3');\n this._txtTrack = TSDemuxer.createTrack('text');\n this._audioTrack.segmentCodec = 'aac';\n\n // flush any partial content\n this.aacOverFlow = null;\n this.avcSample = null;\n this.remainderData = null;\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this._duration = trackDuration;\n };\n _proto.resetTimeStamp = function resetTimeStamp() {};\n _proto.resetContiguity = function resetContiguity() {\n var _audioTrack = this._audioTrack,\n _avcTrack = this._avcTrack,\n _id3Track = this._id3Track;\n if (_audioTrack) {\n _audioTrack.pesData = null;\n }\n if (_avcTrack) {\n _avcTrack.pesData = null;\n }\n if (_id3Track) {\n _id3Track.pesData = null;\n }\n this.aacOverFlow = null;\n this.avcSample = null;\n this.remainderData = null;\n };\n _proto.demux = function demux(data, timeOffset, isSampleAes, flush) {\n if (isSampleAes === void 0) {\n isSampleAes = false;\n }\n if (flush === void 0) {\n flush = false;\n }\n if (!isSampleAes) {\n this.sampleAes = null;\n }\n var pes;\n var videoTrack = this._avcTrack;\n var audioTrack = this._audioTrack;\n var id3Track = this._id3Track;\n var textTrack = this._txtTrack;\n var avcId = videoTrack.pid;\n var avcData = videoTrack.pesData;\n var audioId = audioTrack.pid;\n var id3Id = id3Track.pid;\n var audioData = audioTrack.pesData;\n var id3Data = id3Track.pesData;\n var unknownPID = null;\n var pmtParsed = this.pmtParsed;\n var pmtId = this._pmtId;\n var len = data.length;\n if (this.remainderData) {\n data = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_5__.appendUint8Array)(this.remainderData, data);\n len = data.length;\n this.remainderData = null;\n }\n if (len < PACKET_LENGTH && !flush) {\n this.remainderData = data;\n return {\n audioTrack: audioTrack,\n videoTrack: videoTrack,\n id3Track: id3Track,\n textTrack: textTrack\n };\n }\n var syncOffset = Math.max(0, TSDemuxer.syncOffset(data));\n len -= (len - syncOffset) % PACKET_LENGTH;\n if (len < data.byteLength && !flush) {\n this.remainderData = new Uint8Array(data.buffer, len, data.buffer.byteLength - len);\n }\n\n // loop through TS packets\n var tsPacketErrors = 0;\n for (var start = syncOffset; start < len; start += PACKET_LENGTH) {\n if (data[start] === 0x47) {\n var stt = !!(data[start + 1] & 0x40);\n var pid = parsePID(data, start);\n var atf = (data[start + 3] & 0x30) >> 4;\n\n // if an adaption field is present, its length is specified by the fifth byte of the TS packet header.\n var offset = void 0;\n if (atf > 1) {\n offset = start + 5 + data[start + 4];\n // continue if there is only adaptation field\n if (offset === start + PACKET_LENGTH) {\n continue;\n }\n } else {\n offset = start + 4;\n }\n switch (pid) {\n case avcId:\n if (stt) {\n if (avcData && (pes = parsePES(avcData))) {\n this.parseAVCPES(videoTrack, textTrack, pes, false);\n }\n avcData = {\n data: [],\n size: 0\n };\n }\n if (avcData) {\n avcData.data.push(data.subarray(offset, start + PACKET_LENGTH));\n avcData.size += start + PACKET_LENGTH - offset;\n }\n break;\n case audioId:\n if (stt) {\n if (audioData && (pes = parsePES(audioData))) {\n switch (audioTrack.segmentCodec) {\n case 'aac':\n this.parseAACPES(audioTrack, pes);\n break;\n case 'mp3':\n this.parseMPEGPES(audioTrack, pes);\n break;\n }\n }\n audioData = {\n data: [],\n size: 0\n };\n }\n if (audioData) {\n audioData.data.push(data.subarray(offset, start + PACKET_LENGTH));\n audioData.size += start + PACKET_LENGTH - offset;\n }\n break;\n case id3Id:\n if (stt) {\n if (id3Data && (pes = parsePES(id3Data))) {\n this.parseID3PES(id3Track, pes);\n }\n id3Data = {\n data: [],\n size: 0\n };\n }\n if (id3Data) {\n id3Data.data.push(data.subarray(offset, start + PACKET_LENGTH));\n id3Data.size += start + PACKET_LENGTH - offset;\n }\n break;\n case 0:\n if (stt) {\n offset += data[offset] + 1;\n }\n pmtId = this._pmtId = parsePAT(data, offset);\n // logger.log('PMT PID:' + this._pmtId);\n break;\n case pmtId:\n {\n if (stt) {\n offset += data[offset] + 1;\n }\n var parsedPIDs = parsePMT(data, offset, this.typeSupported, isSampleAes);\n\n // only update track id if track PID found while parsing PMT\n // this is to avoid resetting the PID to -1 in case\n // track PID transiently disappears from the stream\n // this could happen in case of transient missing audio samples for example\n // NOTE this is only the PID of the track as found in TS,\n // but we are not using this for MP4 track IDs.\n avcId = parsedPIDs.avc;\n if (avcId > 0) {\n videoTrack.pid = avcId;\n }\n audioId = parsedPIDs.audio;\n if (audioId > 0) {\n audioTrack.pid = audioId;\n audioTrack.segmentCodec = parsedPIDs.segmentCodec;\n }\n id3Id = parsedPIDs.id3;\n if (id3Id > 0) {\n id3Track.pid = id3Id;\n }\n if (unknownPID !== null && !pmtParsed) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.warn(\"MPEG-TS PMT found at \" + start + \" after unknown PID '\" + unknownPID + \"'. Backtracking to sync byte @\" + syncOffset + \" to parse all TS packets.\");\n unknownPID = null;\n // we set it to -188, the += 188 in the for loop will reset start to 0\n start = syncOffset - 188;\n }\n pmtParsed = this.pmtParsed = true;\n break;\n }\n case 0x11:\n case 0x1fff:\n break;\n default:\n unknownPID = pid;\n break;\n }\n } else {\n tsPacketErrors++;\n }\n }\n if (tsPacketErrors > 0) {\n this.observer.emit(_events__WEBPACK_IMPORTED_MODULE_4__.Events.ERROR, _events__WEBPACK_IMPORTED_MODULE_4__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_7__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_7__.ErrorDetails.FRAG_PARSING_ERROR,\n fatal: false,\n reason: \"Found \" + tsPacketErrors + \" TS packet/s that do not start with 0x47\"\n });\n }\n videoTrack.pesData = avcData;\n audioTrack.pesData = audioData;\n id3Track.pesData = id3Data;\n var demuxResult = {\n audioTrack: audioTrack,\n videoTrack: videoTrack,\n id3Track: id3Track,\n textTrack: textTrack\n };\n if (flush) {\n this.extractRemainingSamples(demuxResult);\n }\n return demuxResult;\n };\n _proto.flush = function flush() {\n var remainderData = this.remainderData;\n this.remainderData = null;\n var result;\n if (remainderData) {\n result = this.demux(remainderData, -1, false, true);\n } else {\n result = {\n videoTrack: this._avcTrack,\n audioTrack: this._audioTrack,\n id3Track: this._id3Track,\n textTrack: this._txtTrack\n };\n }\n this.extractRemainingSamples(result);\n if (this.sampleAes) {\n return this.decrypt(result, this.sampleAes);\n }\n return result;\n };\n _proto.extractRemainingSamples = function extractRemainingSamples(demuxResult) {\n var audioTrack = demuxResult.audioTrack,\n videoTrack = demuxResult.videoTrack,\n id3Track = demuxResult.id3Track,\n textTrack = demuxResult.textTrack;\n var avcData = videoTrack.pesData;\n var audioData = audioTrack.pesData;\n var id3Data = id3Track.pesData;\n // try to parse last PES packets\n var pes;\n if (avcData && (pes = parsePES(avcData))) {\n this.parseAVCPES(videoTrack, textTrack, pes, true);\n videoTrack.pesData = null;\n } else {\n // either avcData null or PES truncated, keep it for next frag parsing\n videoTrack.pesData = avcData;\n }\n if (audioData && (pes = parsePES(audioData))) {\n switch (audioTrack.segmentCodec) {\n case 'aac':\n this.parseAACPES(audioTrack, pes);\n break;\n case 'mp3':\n this.parseMPEGPES(audioTrack, pes);\n break;\n }\n audioTrack.pesData = null;\n } else {\n if (audioData !== null && audioData !== void 0 && audioData.size) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.log('last AAC PES packet truncated,might overlap between fragments');\n }\n\n // either audioData null or PES truncated, keep it for next frag parsing\n audioTrack.pesData = audioData;\n }\n if (id3Data && (pes = parsePES(id3Data))) {\n this.parseID3PES(id3Track, pes);\n id3Track.pesData = null;\n } else {\n // either id3Data null or PES truncated, keep it for next frag parsing\n id3Track.pesData = id3Data;\n }\n };\n _proto.demuxSampleAes = function demuxSampleAes(data, keyData, timeOffset) {\n var demuxResult = this.demux(data, timeOffset, true, !this.config.progressive);\n var sampleAes = this.sampleAes = new _sample_aes__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.observer, this.config, keyData);\n return this.decrypt(demuxResult, sampleAes);\n };\n _proto.decrypt = function decrypt(demuxResult, sampleAes) {\n return new Promise(function (resolve) {\n var audioTrack = demuxResult.audioTrack,\n videoTrack = demuxResult.videoTrack;\n if (audioTrack.samples && audioTrack.segmentCodec === 'aac') {\n sampleAes.decryptAacSamples(audioTrack.samples, 0, function () {\n if (videoTrack.samples) {\n sampleAes.decryptAvcSamples(videoTrack.samples, 0, 0, function () {\n resolve(demuxResult);\n });\n } else {\n resolve(demuxResult);\n }\n });\n } else if (videoTrack.samples) {\n sampleAes.decryptAvcSamples(videoTrack.samples, 0, 0, function () {\n resolve(demuxResult);\n });\n }\n });\n };\n _proto.destroy = function destroy() {\n this._duration = 0;\n };\n _proto.parseAVCPES = function parseAVCPES(track, textTrack, pes, last) {\n var _this = this;\n var units = this.parseAVCNALu(track, pes.data);\n var debug = false;\n var avcSample = this.avcSample;\n var push;\n var spsfound = false;\n // free pes.data to save up some memory\n pes.data = null;\n\n // if new NAL units found and last sample still there, let's push ...\n // this helps parsing streams with missing AUD (only do this if AUD never found)\n if (avcSample && units.length && !track.audFound) {\n pushAccessUnit(avcSample, track);\n avcSample = this.avcSample = createAVCSample(false, pes.pts, pes.dts, '');\n }\n units.forEach(function (unit) {\n switch (unit.type) {\n // NDR\n case 1:\n {\n push = true;\n if (!avcSample) {\n avcSample = _this.avcSample = createAVCSample(true, pes.pts, pes.dts, '');\n }\n if (debug) {\n avcSample.debug += 'NDR ';\n }\n avcSample.frame = true;\n var data = unit.data;\n // only check slice type to detect KF in case SPS found in same packet (any keyframe is preceded by SPS ...)\n if (spsfound && data.length > 4) {\n // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR\n var sliceType = new _exp_golomb__WEBPACK_IMPORTED_MODULE_2__[\"default\"](data).readSliceType();\n // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice\n // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.\n // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.\n // I slice: A slice that is not an SI slice that is decoded using intra prediction only.\n // if (sliceType === 2 || sliceType === 7) {\n if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {\n avcSample.key = true;\n }\n }\n break;\n // IDR\n }\n\n case 5:\n push = true;\n // handle PES not starting with AUD\n if (!avcSample) {\n avcSample = _this.avcSample = createAVCSample(true, pes.pts, pes.dts, '');\n }\n if (debug) {\n avcSample.debug += 'IDR ';\n }\n avcSample.key = true;\n avcSample.frame = true;\n break;\n // SEI\n case 6:\n {\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'SEI ';\n }\n (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_5__.parseSEIMessageFromNALu)(unit.data, 1, pes.pts, textTrack.samples);\n break;\n // SPS\n }\n\n case 7:\n push = true;\n spsfound = true;\n if (debug && avcSample) {\n avcSample.debug += 'SPS ';\n }\n if (!track.sps) {\n var expGolombDecoder = new _exp_golomb__WEBPACK_IMPORTED_MODULE_2__[\"default\"](unit.data);\n var config = expGolombDecoder.readSPS();\n track.width = config.width;\n track.height = config.height;\n track.pixelRatio = config.pixelRatio;\n // TODO: `track.sps` is defined as a `number[]`, but we're setting it to a `Uint8Array[]`.\n track.sps = [unit.data];\n track.duration = _this._duration;\n var codecarray = unit.data.subarray(1, 4);\n var codecstring = 'avc1.';\n for (var i = 0; i < 3; i++) {\n var h = codecarray[i].toString(16);\n if (h.length < 2) {\n h = '0' + h;\n }\n codecstring += h;\n }\n track.codec = codecstring;\n }\n break;\n // PPS\n case 8:\n push = true;\n if (debug && avcSample) {\n avcSample.debug += 'PPS ';\n }\n if (!track.pps) {\n // TODO: `track.pss` is defined as a `number[]`, but we're setting it to a `Uint8Array[]`.\n track.pps = [unit.data];\n }\n break;\n // AUD\n case 9:\n push = false;\n track.audFound = true;\n if (avcSample) {\n pushAccessUnit(avcSample, track);\n }\n avcSample = _this.avcSample = createAVCSample(false, pes.pts, pes.dts, debug ? 'AUD ' : '');\n break;\n // Filler Data\n case 12:\n push = true;\n break;\n default:\n push = false;\n if (avcSample) {\n avcSample.debug += 'unknown NAL ' + unit.type + ' ';\n }\n break;\n }\n if (avcSample && push) {\n var _units = avcSample.units;\n _units.push(unit);\n }\n });\n // if last PES packet, push samples\n if (last && avcSample) {\n pushAccessUnit(avcSample, track);\n this.avcSample = null;\n }\n };\n _proto.getLastNalUnit = function getLastNalUnit(samples) {\n var _avcSample;\n var avcSample = this.avcSample;\n var lastUnit;\n // try to fallback to previous sample if current one is empty\n if (!avcSample || avcSample.units.length === 0) {\n avcSample = samples[samples.length - 1];\n }\n if ((_avcSample = avcSample) !== null && _avcSample !== void 0 && _avcSample.units) {\n var units = avcSample.units;\n lastUnit = units[units.length - 1];\n }\n return lastUnit;\n };\n _proto.parseAVCNALu = function parseAVCNALu(track, array) {\n var len = array.byteLength;\n var state = track.naluState || 0;\n var lastState = state;\n var units = [];\n var i = 0;\n var value;\n var overflow;\n var unitType;\n var lastUnitStart = -1;\n var lastUnitType = 0;\n // logger.log('PES:' + Hex.hexDump(array));\n\n if (state === -1) {\n // special use case where we found 3 or 4-byte start codes exactly at the end of previous PES packet\n lastUnitStart = 0;\n // NALu type is value read from offset 0\n lastUnitType = array[0] & 0x1f;\n state = 0;\n i = 1;\n }\n while (i < len) {\n value = array[i++];\n // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case\n if (!state) {\n state = value ? 0 : 1;\n continue;\n }\n if (state === 1) {\n state = value ? 0 : 2;\n continue;\n }\n // here we have state either equal to 2 or 3\n if (!value) {\n state = 3;\n } else if (value === 1) {\n if (lastUnitStart >= 0) {\n var unit = {\n data: array.subarray(lastUnitStart, i - state - 1),\n type: lastUnitType\n };\n // logger.log('pushing NALU, type/size:' + unit.type + '/' + unit.data.byteLength);\n units.push(unit);\n } else {\n // lastUnitStart is undefined => this is the first start code found in this PES packet\n // first check if start code delimiter is overlapping between 2 PES packets,\n // ie it started in last packet (lastState not zero)\n // and ended at the beginning of this PES packet (i <= 4 - lastState)\n var lastUnit = this.getLastNalUnit(track.samples);\n if (lastUnit) {\n if (lastState && i <= 4 - lastState) {\n // start delimiter overlapping between PES packets\n // strip start delimiter bytes from the end of last NAL unit\n // check if lastUnit had a state different from zero\n if (lastUnit.state) {\n // strip last bytes\n lastUnit.data = lastUnit.data.subarray(0, lastUnit.data.byteLength - lastState);\n }\n }\n // If NAL units are not starting right at the beginning of the PES packet, push preceding data into previous NAL unit.\n overflow = i - state - 1;\n if (overflow > 0) {\n // logger.log('first NALU found with overflow:' + overflow);\n var tmp = new Uint8Array(lastUnit.data.byteLength + overflow);\n tmp.set(lastUnit.data, 0);\n tmp.set(array.subarray(0, overflow), lastUnit.data.byteLength);\n lastUnit.data = tmp;\n lastUnit.state = 0;\n }\n }\n }\n // check if we can read unit type\n if (i < len) {\n unitType = array[i] & 0x1f;\n // logger.log('find NALU @ offset:' + i + ',type:' + unitType);\n lastUnitStart = i;\n lastUnitType = unitType;\n state = 0;\n } else {\n // not enough byte to read unit type. let's read it on next PES parsing\n state = -1;\n }\n } else {\n state = 0;\n }\n }\n if (lastUnitStart >= 0 && state >= 0) {\n var _unit = {\n data: array.subarray(lastUnitStart, len),\n type: lastUnitType,\n state: state\n };\n units.push(_unit);\n // logger.log('pushing NALU, type/size/state:' + unit.type + '/' + unit.data.byteLength + '/' + state);\n }\n // no NALu found\n if (units.length === 0) {\n // append pes.data to previous NAL unit\n var _lastUnit = this.getLastNalUnit(track.samples);\n if (_lastUnit) {\n var _tmp = new Uint8Array(_lastUnit.data.byteLength + array.byteLength);\n _tmp.set(_lastUnit.data, 0);\n _tmp.set(array, _lastUnit.data.byteLength);\n _lastUnit.data = _tmp;\n }\n }\n track.naluState = state;\n return units;\n };\n _proto.parseAACPES = function parseAACPES(track, pes) {\n var startOffset = 0;\n var aacOverFlow = this.aacOverFlow;\n var data = pes.data;\n if (aacOverFlow) {\n this.aacOverFlow = null;\n var frameMissingBytes = aacOverFlow.missing;\n var sampleLength = aacOverFlow.sample.unit.byteLength;\n // logger.log(`AAC: append overflowing ${sampleLength} bytes to beginning of new PES`);\n if (frameMissingBytes === -1) {\n var tmp = new Uint8Array(sampleLength + data.byteLength);\n tmp.set(aacOverFlow.sample.unit, 0);\n tmp.set(data, sampleLength);\n data = tmp;\n } else {\n var frameOverflowBytes = sampleLength - frameMissingBytes;\n aacOverFlow.sample.unit.set(data.subarray(0, frameMissingBytes), frameOverflowBytes);\n track.samples.push(aacOverFlow.sample);\n startOffset = aacOverFlow.missing;\n }\n }\n // look for ADTS header (0xFFFx)\n var offset;\n var len;\n for (offset = startOffset, len = data.length; offset < len - 1; offset++) {\n if (_adts__WEBPACK_IMPORTED_MODULE_0__.isHeader(data, offset)) {\n break;\n }\n }\n // if ADTS header does not start straight from the beginning of the PES payload, raise an error\n if (offset !== startOffset) {\n var reason;\n var fatal;\n if (offset < len - 1) {\n reason = \"AAC PES did not start with ADTS header,offset:\" + offset;\n fatal = false;\n } else {\n reason = 'no ADTS header found in AAC PES';\n fatal = true;\n }\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.warn(\"parsing error:\" + reason);\n this.observer.emit(_events__WEBPACK_IMPORTED_MODULE_4__.Events.ERROR, _events__WEBPACK_IMPORTED_MODULE_4__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_7__.ErrorTypes.MEDIA_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_7__.ErrorDetails.FRAG_PARSING_ERROR,\n fatal: fatal,\n reason: reason\n });\n if (fatal) {\n return;\n }\n }\n _adts__WEBPACK_IMPORTED_MODULE_0__.initTrackConfig(track, this.observer, data, offset, this.audioCodec);\n var pts;\n if (pes.pts !== undefined) {\n pts = pes.pts;\n } else if (aacOverFlow) {\n // if last AAC frame is overflowing, we should ensure timestamps are contiguous:\n // first sample PTS should be equal to last sample PTS + frameDuration\n var frameDuration = _adts__WEBPACK_IMPORTED_MODULE_0__.getFrameDuration(track.samplerate);\n pts = aacOverFlow.sample.pts + frameDuration;\n } else {\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.warn('[tsdemuxer]: AAC PES unknown PTS');\n return;\n }\n\n // scan for aac samples\n var frameIndex = 0;\n var frame;\n while (offset < len) {\n frame = _adts__WEBPACK_IMPORTED_MODULE_0__.appendFrame(track, data, offset, pts, frameIndex);\n offset += frame.length;\n if (!frame.missing) {\n frameIndex++;\n for (; offset < len - 1; offset++) {\n if (_adts__WEBPACK_IMPORTED_MODULE_0__.isHeader(data, offset)) {\n break;\n }\n }\n } else {\n this.aacOverFlow = frame;\n break;\n }\n }\n };\n _proto.parseMPEGPES = function parseMPEGPES(track, pes) {\n var data = pes.data;\n var length = data.length;\n var frameIndex = 0;\n var offset = 0;\n var pts = pes.pts;\n if (pts === undefined) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.warn('[tsdemuxer]: MPEG PES unknown PTS');\n return;\n }\n while (offset < length) {\n if (_mpegaudio__WEBPACK_IMPORTED_MODULE_1__.isHeader(data, offset)) {\n var frame = _mpegaudio__WEBPACK_IMPORTED_MODULE_1__.appendFrame(track, data, offset, pts, frameIndex);\n if (frame) {\n offset += frame.length;\n frameIndex++;\n } else {\n // logger.log('Unable to parse Mpeg audio frame');\n break;\n }\n } else {\n // nothing found, keep looking\n offset++;\n }\n }\n };\n _proto.parseID3PES = function parseID3PES(id3Track, pes) {\n if (pes.pts === undefined) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.warn('[tsdemuxer]: ID3 PES unknown PTS');\n return;\n }\n var id3Sample = _extends({}, pes, {\n type: this._avcTrack ? _types_demuxer__WEBPACK_IMPORTED_MODULE_8__.MetadataSchema.emsg : _types_demuxer__WEBPACK_IMPORTED_MODULE_8__.MetadataSchema.audioId3,\n duration: Number.POSITIVE_INFINITY\n });\n id3Track.samples.push(id3Sample);\n };\n return TSDemuxer;\n}();\nfunction createAVCSample(key, pts, dts, debug) {\n return {\n key: key,\n frame: false,\n pts: pts,\n dts: dts,\n units: [],\n debug: debug,\n length: 0\n };\n}\nfunction parsePID(data, offset) {\n // pid is a 13-bit field starting at the last bit of TS[1]\n return ((data[offset + 1] & 0x1f) << 8) + data[offset + 2];\n}\nfunction parsePAT(data, offset) {\n // skip the PSI header and parse the first PMT entry\n return (data[offset + 10] & 0x1f) << 8 | data[offset + 11];\n}\nfunction parsePMT(data, offset, typeSupported, isSampleAes) {\n var result = {\n audio: -1,\n avc: -1,\n id3: -1,\n segmentCodec: 'aac'\n };\n var sectionLength = (data[offset + 1] & 0x0f) << 8 | data[offset + 2];\n var tableEnd = offset + 3 + sectionLength - 4;\n // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n var programInfoLength = (data[offset + 10] & 0x0f) << 8 | data[offset + 11];\n // advance the offset to the first entry in the mapping table\n offset += 12 + programInfoLength;\n while (offset < tableEnd) {\n var pid = parsePID(data, offset);\n switch (data[offset]) {\n case 0xcf:\n // SAMPLE-AES AAC\n if (!isSampleAes) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.log('ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream');\n break;\n }\n /* falls through */\n case 0x0f:\n // ISO/IEC 13818-7 ADTS AAC (MPEG-2 lower bit-rate audio)\n // logger.log('AAC PID:' + pid);\n if (result.audio === -1) {\n result.audio = pid;\n }\n break;\n\n // Packetized metadata (ID3)\n case 0x15:\n // logger.log('ID3 PID:' + pid);\n if (result.id3 === -1) {\n result.id3 = pid;\n }\n break;\n case 0xdb:\n // SAMPLE-AES AVC\n if (!isSampleAes) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.log('H.264 with AES-128-CBC slice encryption found in unencrypted stream');\n break;\n }\n /* falls through */\n case 0x1b:\n // ITU-T Rec. H.264 and ISO/IEC 14496-10 (lower bit-rate video)\n // logger.log('AVC PID:' + pid);\n if (result.avc === -1) {\n result.avc = pid;\n }\n break;\n\n // ISO/IEC 11172-3 (MPEG-1 audio)\n // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)\n case 0x03:\n case 0x04:\n // logger.log('MPEG PID:' + pid);\n if (typeSupported.mpeg !== true && typeSupported.mp3 !== true) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.log('MPEG audio found, not supported in this browser');\n } else if (result.audio === -1) {\n result.audio = pid;\n result.segmentCodec = 'mp3';\n }\n break;\n case 0x24:\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.warn('Unsupported HEVC stream type found');\n break;\n default:\n // logger.log('unknown stream type:' + data[offset]);\n break;\n }\n // move to the next table entry\n // skip past the elementary stream descriptors, if present\n offset += ((data[offset + 3] & 0x0f) << 8 | data[offset + 4]) + 5;\n }\n return result;\n}\nfunction parsePES(stream) {\n var i = 0;\n var frag;\n var pesLen;\n var pesHdrLen;\n var pesPts;\n var pesDts;\n var data = stream.data;\n // safety check\n if (!stream || stream.size === 0) {\n return null;\n }\n\n // we might need up to 19 bytes to read PES header\n // if first chunk of data is less than 19 bytes, let's merge it with following ones until we get 19 bytes\n // usually only one merge is needed (and this is rare ...)\n while (data[0].length < 19 && data.length > 1) {\n var newData = new Uint8Array(data[0].length + data[1].length);\n newData.set(data[0]);\n newData.set(data[1], data[0].length);\n data[0] = newData;\n data.splice(1, 1);\n }\n // retrieve PTS/DTS from first fragment\n frag = data[0];\n var pesPrefix = (frag[0] << 16) + (frag[1] << 8) + frag[2];\n if (pesPrefix === 1) {\n pesLen = (frag[4] << 8) + frag[5];\n // if PES parsed length is not zero and greater than total received length, stop parsing. PES might be truncated\n // minus 6 : PES header size\n if (pesLen && pesLen > stream.size - 6) {\n return null;\n }\n var pesFlags = frag[7];\n if (pesFlags & 0xc0) {\n /* PES header described here : http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n as PTS / DTS is 33 bit we cannot use bitwise operator in JS,\n as Bitwise operators treat their operands as a sequence of 32 bits */\n pesPts = (frag[9] & 0x0e) * 536870912 +\n // 1 << 29\n (frag[10] & 0xff) * 4194304 +\n // 1 << 22\n (frag[11] & 0xfe) * 16384 +\n // 1 << 14\n (frag[12] & 0xff) * 128 +\n // 1 << 7\n (frag[13] & 0xfe) / 2;\n if (pesFlags & 0x40) {\n pesDts = (frag[14] & 0x0e) * 536870912 +\n // 1 << 29\n (frag[15] & 0xff) * 4194304 +\n // 1 << 22\n (frag[16] & 0xfe) * 16384 +\n // 1 << 14\n (frag[17] & 0xff) * 128 +\n // 1 << 7\n (frag[18] & 0xfe) / 2;\n if (pesPts - pesDts > 60 * 90000) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.warn(Math.round((pesPts - pesDts) / 90000) + \"s delta between PTS and DTS, align them\");\n pesPts = pesDts;\n }\n } else {\n pesDts = pesPts;\n }\n }\n pesHdrLen = frag[8];\n // 9 bytes : 6 bytes for PES header + 3 bytes for PES extension\n var payloadStartOffset = pesHdrLen + 9;\n if (stream.size <= payloadStartOffset) {\n return null;\n }\n stream.size -= payloadStartOffset;\n // reassemble PES packet\n var pesData = new Uint8Array(stream.size);\n for (var j = 0, dataLen = data.length; j < dataLen; j++) {\n frag = data[j];\n var len = frag.byteLength;\n if (payloadStartOffset) {\n if (payloadStartOffset > len) {\n // trim full frag if PES header bigger than frag\n payloadStartOffset -= len;\n continue;\n } else {\n // trim partial frag if PES header smaller than frag\n frag = frag.subarray(payloadStartOffset);\n len -= payloadStartOffset;\n payloadStartOffset = 0;\n }\n }\n pesData.set(frag, i);\n i += len;\n }\n if (pesLen) {\n // payload size : remove PES header + PES extension\n pesLen -= pesHdrLen + 3;\n }\n return {\n data: pesData,\n pts: pesPts,\n dts: pesDts,\n len: pesLen\n };\n }\n return null;\n}\nfunction pushAccessUnit(avcSample, avcTrack) {\n if (avcSample.units.length && avcSample.frame) {\n // if sample does not have PTS/DTS, patch with last sample PTS/DTS\n if (avcSample.pts === undefined) {\n var samples = avcTrack.samples;\n var nbSamples = samples.length;\n if (nbSamples) {\n var lastSample = samples[nbSamples - 1];\n avcSample.pts = lastSample.pts;\n avcSample.dts = lastSample.dts;\n } else {\n // dropping samples, no timestamp found\n avcTrack.dropped++;\n return;\n }\n }\n avcTrack.samples.push(avcSample);\n }\n if (avcSample.debug.length) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_6__.logger.log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug);\n }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TSDemuxer);\n\n/***/ }),\n\n/***/ \"./src/demux/webworkify-webpack.js\":\n/*!*****************************************!*\\\n !*** ./src/demux/webworkify-webpack.js ***!\n \\*****************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n * Fork of webworkify-webpack with support for Webpack 5\n * https://github.com/wupeng-engineer/webworkify-webpack/blob/db0de7/index.js\n*/\n\nvar webpackBootstrapFunc = function webpackBootstrapFunc() {\n // webpackBootstrap\n /******/\n var __webpack_modules__ = ENTRY_MODULE;\n /************************************************************************/\n /******/ // The module cache\n /******/\n var __webpack_module_cache__ = {};\n /******/\n /******/ // The require function\n /******/\n var __nested_webpack_require_497__ = function __webpack_require__(moduleId) {\n /******/ // Check if module is in cache\n /******/var cachedModule = __webpack_module_cache__[moduleId];\n /******/\n if (cachedModule !== undefined) {\n /******/return cachedModule.exports;\n /******/\n }\n /******/ // Create a new module (and put it into the cache)\n /******/\n var module = __webpack_module_cache__[moduleId] = {\n /******/ // no module.id needed\n /******/ // no module.loaded needed\n /******/exports: {}\n /******/\n };\n /******/\n /******/ // Execute the module function\n /******/\n __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n /******/\n /******/ // Return the exports of the module\n /******/\n return module.exports;\n /******/\n };\n /******/\n /******/ // expose the modules object (__webpack_modules__)\n /******/\n __nested_webpack_require_497__.m = __webpack_modules__;\n /******/\n /************************************************************************/\n /******/ /* webpack/runtime/compat get default export */\n /******/\n (function () {\n /******/ // getDefaultExport function for compatibility with non-harmony modules\n /******/__nested_webpack_require_497__.n = function (module) {\n /******/var getter = module && module.__esModule ? /******/function () {\n return module['default'];\n } : /******/function () {\n return module;\n };\n /******/\n __nested_webpack_require_497__.d(getter, {\n a: getter\n });\n /******/\n return getter;\n /******/\n };\n /******/\n })();\n /******/\n /******/ /* webpack/runtime/define property getters */\n /******/\n (function () {\n /******/ // define getter functions for harmony exports\n /******/__nested_webpack_require_497__.d = function (exports, definition) {\n /******/for (var key in definition) {\n /******/if (__nested_webpack_require_497__.o(definition, key) && !__nested_webpack_require_497__.o(exports, key)) {\n /******/Object.defineProperty(exports, key, {\n enumerable: true,\n get: definition[key]\n });\n /******/\n }\n /******/\n }\n /******/\n };\n /******/\n })();\n /******/\n /******/ /* webpack/runtime/hasOwnProperty shorthand */\n /******/\n (function () {\n /******/__nested_webpack_require_497__.o = function (obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n };\n /******/\n })();\n /******/\n /******/ /* webpack/runtime/make namespace object */\n /******/\n (function () {\n /******/ // define __esModule on exports\n /******/__nested_webpack_require_497__.r = function (exports) {\n /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n /******/Object.defineProperty(exports, Symbol.toStringTag, {\n value: 'Module'\n });\n /******/\n }\n /******/\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n /******/\n };\n /******/\n })();\n /******/\n /************************************************************************/\n /******/\n /******/ // module factories are used so entry inlining is disabled\n /******/ // startup\n /******/ // Load entry module and return exports\n /******/\n var result = __nested_webpack_require_497__(ENTRY_MODULE);\n /******/\n return result.default || result;\n};\nvar webpackBootstrapFuncArr = webpackBootstrapFunc.toString().split('ENTRY_MODULE');\nvar moduleNameReqExp = '[\\\\.|\\\\-|\\\\+|\\\\w|\\/|@]+';\nvar dependencyRegExp = '\\\\(\\\\s*(\\/\\\\*.*?\\\\*\\/)?\\\\s*.*?(' + moduleNameReqExp + ').*?\\\\)';\nfunction quoteRegExp(str) {\n return (str + '').replace(/[.?*+^$[\\]\\\\(){}|-]/g, '\\\\$&');\n}\nfunction isNumeric(n) {\n return !isNaN(1 * n);\n}\nfunction getModuleDependencies(sources, module, queueName) {\n var retval = {};\n retval[queueName] = [];\n var fnString = module.toString().replace(/^\"[^\"]+\"/, 'function');\n ;\n var wrapperSignature = fnString.match(/^function\\s?\\w*\\(\\w+,\\s*\\w+,\\s*(\\w+)\\)/) || fnString.match(/^\\(\\w+,\\s*\\w+,\\s*(\\w+)\\)\\s?\\=\\s?\\>/);\n if (!wrapperSignature) return retval;\n var webpackRequireName = wrapperSignature[1];\n var re = new RegExp('(\\\\\\\\n|\\\\W)' + quoteRegExp(webpackRequireName) + dependencyRegExp, 'g');\n var match;\n while (match = re.exec(fnString)) {\n if (match[3] === 'dll-reference') continue;\n retval[queueName].push(match[3]);\n }\n re = new RegExp('\\\\(' + quoteRegExp(webpackRequireName) + '\\\\(\"(dll-reference\\\\s(' + moduleNameReqExp + '))\"\\\\)\\\\)' + dependencyRegExp, 'g');\n while (match = re.exec(fnString)) {\n if (!sources[match[2]]) {\n retval[queueName].push(match[1]);\n sources[match[2]] = __webpack_require__(match[1]).m;\n }\n retval[match[2]] = retval[match[2]] || [];\n retval[match[2]].push(match[4]);\n }\n var keys = Object.keys(retval);\n for (var i = 0; i < keys.length; i++) {\n for (var j = 0; j < retval[keys[i]].length; j++) {\n if (isNumeric(retval[keys[i]][j])) {\n retval[keys[i]][j] = 1 * retval[keys[i]][j];\n }\n }\n }\n return retval;\n}\nfunction hasValuesInQueues(queues) {\n var keys = Object.keys(queues);\n return keys.reduce(function (hasValues, key) {\n return hasValues || queues[key].length > 0;\n }, false);\n}\nfunction getRequiredModules(sources, moduleId) {\n var modulesQueue = {\n main: [moduleId]\n };\n var requiredModules = {\n main: []\n };\n var seenModules = {\n main: {}\n };\n while (hasValuesInQueues(modulesQueue)) {\n var queues = Object.keys(modulesQueue);\n for (var i = 0; i < queues.length; i++) {\n var queueName = queues[i];\n var queue = modulesQueue[queueName];\n var moduleToCheck = queue.pop();\n seenModules[queueName] = seenModules[queueName] || {};\n if (seenModules[queueName][moduleToCheck] || !sources[queueName][moduleToCheck]) continue;\n seenModules[queueName][moduleToCheck] = true;\n requiredModules[queueName] = requiredModules[queueName] || [];\n requiredModules[queueName].push(moduleToCheck);\n var newModules = getModuleDependencies(sources, sources[queueName][moduleToCheck], queueName);\n var newModulesKeys = Object.keys(newModules);\n for (var j = 0; j < newModulesKeys.length; j++) {\n modulesQueue[newModulesKeys[j]] = modulesQueue[newModulesKeys[j]] || [];\n modulesQueue[newModulesKeys[j]] = modulesQueue[newModulesKeys[j]].concat(newModules[newModulesKeys[j]]);\n }\n }\n }\n return requiredModules;\n}\nfunction getWebpackString(requiredModules, sources, entryModule, key) {\n var moduleString = requiredModules[key].map(function (id) {\n return \"\\\"\" + id + \"\\\": \" + sources[key][id].toString().replace(/^\"[^\"]+\"/, 'function');\n }).join(\",\");\n return webpackBootstrapFuncArr[0] + \"{\" + moduleString + \"}\" + webpackBootstrapFuncArr[1] + \"\\\"\" + entryModule + \"\\\"\" + webpackBootstrapFuncArr[2];\n}\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(moduleId, options) {\n options = options || {};\n var sources = {\n main: __webpack_require__.m\n };\n var requiredModules = options.all ? {\n main: Object.keys(sources.main)\n } : getRequiredModules(sources, moduleId);\n var src = '';\n Object.keys(requiredModules).filter(function (m) {\n return m !== 'main';\n }).forEach(function (module) {\n var entryModule = 0;\n while (requiredModules[module][entryModule]) {\n entryModule++;\n }\n requiredModules[module].push(entryModule);\n sources[module][entryModule] = '(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })';\n src = src + (\"var \" + module + \" = (\" + getWebpackString(requiredModules, sources, entryModule, modules) + \")();\\n\");\n });\n src = src + (\"new ((\" + getWebpackString(requiredModules, sources, moduleId, 'main') + \")())(self);\");\n var blob = new window.Blob([src], {\n type: 'text/javascript'\n });\n var URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\n var workerUrl = URL.createObjectURL(blob);\n var worker = new window.Worker(workerUrl);\n worker.objectURL = workerUrl;\n return worker;\n}\n\n/***/ }),\n\n/***/ \"./src/empty.js\":\n/*!**********************!*\\\n !*** ./src/empty.js ***!\n \\**********************/\n/***/ ((module) => {\n\n// This file is inserted as a shim for modules which we do not want to include into the distro.\n// This replacement is done in the \"resolve\" section of the webpack config.\nmodule.exports = undefined;\n\n/***/ }),\n\n/***/ \"./src/errors.ts\":\n/*!***********************!*\\\n !*** ./src/errors.ts ***!\n \\***********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ErrorDetails\": () => (/* binding */ ErrorDetails),\n/* harmony export */ \"ErrorTypes\": () => (/* binding */ ErrorTypes)\n/* harmony export */ });\nvar ErrorTypes;\n\n/**\n * @enum {ErrorDetails}\n * @typedef {string} ErrorDetail\n */\n(function (ErrorTypes) {\n ErrorTypes[\"NETWORK_ERROR\"] = \"networkError\";\n ErrorTypes[\"MEDIA_ERROR\"] = \"mediaError\";\n ErrorTypes[\"KEY_SYSTEM_ERROR\"] = \"keySystemError\";\n ErrorTypes[\"MUX_ERROR\"] = \"muxError\";\n ErrorTypes[\"OTHER_ERROR\"] = \"otherError\";\n})(ErrorTypes || (ErrorTypes = {}));\nvar ErrorDetails;\n(function (ErrorDetails) {\n ErrorDetails[\"KEY_SYSTEM_NO_KEYS\"] = \"keySystemNoKeys\";\n ErrorDetails[\"KEY_SYSTEM_NO_ACCESS\"] = \"keySystemNoAccess\";\n ErrorDetails[\"KEY_SYSTEM_NO_SESSION\"] = \"keySystemNoSession\";\n ErrorDetails[\"KEY_SYSTEM_NO_CONFIGURED_LICENSE\"] = \"keySystemNoConfiguredLicense\";\n ErrorDetails[\"KEY_SYSTEM_LICENSE_REQUEST_FAILED\"] = \"keySystemLicenseRequestFailed\";\n ErrorDetails[\"KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED\"] = \"keySystemServerCertificateRequestFailed\";\n ErrorDetails[\"KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED\"] = \"keySystemServerCertificateUpdateFailed\";\n ErrorDetails[\"KEY_SYSTEM_SESSION_UPDATE_FAILED\"] = \"keySystemSessionUpdateFailed\";\n ErrorDetails[\"KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED\"] = \"keySystemStatusOutputRestricted\";\n ErrorDetails[\"KEY_SYSTEM_STATUS_INTERNAL_ERROR\"] = \"keySystemStatusInternalError\";\n ErrorDetails[\"MANIFEST_LOAD_ERROR\"] = \"manifestLoadError\";\n ErrorDetails[\"MANIFEST_LOAD_TIMEOUT\"] = \"manifestLoadTimeOut\";\n ErrorDetails[\"MANIFEST_PARSING_ERROR\"] = \"manifestParsingError\";\n ErrorDetails[\"MANIFEST_INCOMPATIBLE_CODECS_ERROR\"] = \"manifestIncompatibleCodecsError\";\n ErrorDetails[\"LEVEL_EMPTY_ERROR\"] = \"levelEmptyError\";\n ErrorDetails[\"LEVEL_LOAD_ERROR\"] = \"levelLoadError\";\n ErrorDetails[\"LEVEL_LOAD_TIMEOUT\"] = \"levelLoadTimeOut\";\n ErrorDetails[\"LEVEL_SWITCH_ERROR\"] = \"levelSwitchError\";\n ErrorDetails[\"AUDIO_TRACK_LOAD_ERROR\"] = \"audioTrackLoadError\";\n ErrorDetails[\"AUDIO_TRACK_LOAD_TIMEOUT\"] = \"audioTrackLoadTimeOut\";\n ErrorDetails[\"SUBTITLE_LOAD_ERROR\"] = \"subtitleTrackLoadError\";\n ErrorDetails[\"SUBTITLE_TRACK_LOAD_TIMEOUT\"] = \"subtitleTrackLoadTimeOut\";\n ErrorDetails[\"FRAG_LOAD_ERROR\"] = \"fragLoadError\";\n ErrorDetails[\"FRAG_LOAD_TIMEOUT\"] = \"fragLoadTimeOut\";\n ErrorDetails[\"FRAG_DECRYPT_ERROR\"] = \"fragDecryptError\";\n ErrorDetails[\"FRAG_PARSING_ERROR\"] = \"fragParsingError\";\n ErrorDetails[\"REMUX_ALLOC_ERROR\"] = \"remuxAllocError\";\n ErrorDetails[\"KEY_LOAD_ERROR\"] = \"keyLoadError\";\n ErrorDetails[\"KEY_LOAD_TIMEOUT\"] = \"keyLoadTimeOut\";\n ErrorDetails[\"BUFFER_ADD_CODEC_ERROR\"] = \"bufferAddCodecError\";\n ErrorDetails[\"BUFFER_INCOMPATIBLE_CODECS_ERROR\"] = \"bufferIncompatibleCodecsError\";\n ErrorDetails[\"BUFFER_APPEND_ERROR\"] = \"bufferAppendError\";\n ErrorDetails[\"BUFFER_APPENDING_ERROR\"] = \"bufferAppendingError\";\n ErrorDetails[\"BUFFER_STALLED_ERROR\"] = \"bufferStalledError\";\n ErrorDetails[\"BUFFER_FULL_ERROR\"] = \"bufferFullError\";\n ErrorDetails[\"BUFFER_SEEK_OVER_HOLE\"] = \"bufferSeekOverHole\";\n ErrorDetails[\"BUFFER_NUDGE_ON_STALL\"] = \"bufferNudgeOnStall\";\n ErrorDetails[\"INTERNAL_EXCEPTION\"] = \"internalException\";\n ErrorDetails[\"INTERNAL_ABORTED\"] = \"aborted\";\n ErrorDetails[\"UNKNOWN\"] = \"unknown\";\n})(ErrorDetails || (ErrorDetails = {}));\n\n/***/ }),\n\n/***/ \"./src/events.ts\":\n/*!***********************!*\\\n !*** ./src/events.ts ***!\n \\***********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Events\": () => (/* binding */ Events)\n/* harmony export */ });\n/**\n * @readonly\n * @enum {string}\n */\nvar Events;\n(function (Events) {\n Events[\"MEDIA_ATTACHING\"] = \"hlsMediaAttaching\";\n Events[\"MEDIA_ATTACHED\"] = \"hlsMediaAttached\";\n Events[\"MEDIA_DETACHING\"] = \"hlsMediaDetaching\";\n Events[\"MEDIA_DETACHED\"] = \"hlsMediaDetached\";\n Events[\"BUFFER_RESET\"] = \"hlsBufferReset\";\n Events[\"BUFFER_CODECS\"] = \"hlsBufferCodecs\";\n Events[\"BUFFER_CREATED\"] = \"hlsBufferCreated\";\n Events[\"BUFFER_APPENDING\"] = \"hlsBufferAppending\";\n Events[\"BUFFER_APPENDED\"] = \"hlsBufferAppended\";\n Events[\"BUFFER_EOS\"] = \"hlsBufferEos\";\n Events[\"BUFFER_FLUSHING\"] = \"hlsBufferFlushing\";\n Events[\"BUFFER_FLUSHED\"] = \"hlsBufferFlushed\";\n Events[\"MANIFEST_LOADING\"] = \"hlsManifestLoading\";\n Events[\"MANIFEST_LOADED\"] = \"hlsManifestLoaded\";\n Events[\"MANIFEST_PARSED\"] = \"hlsManifestParsed\";\n Events[\"LEVEL_SWITCHING\"] = \"hlsLevelSwitching\";\n Events[\"LEVEL_SWITCHED\"] = \"hlsLevelSwitched\";\n Events[\"LEVEL_LOADING\"] = \"hlsLevelLoading\";\n Events[\"LEVEL_LOADED\"] = \"hlsLevelLoaded\";\n Events[\"LEVEL_UPDATED\"] = \"hlsLevelUpdated\";\n Events[\"LEVEL_PTS_UPDATED\"] = \"hlsLevelPtsUpdated\";\n Events[\"LEVELS_UPDATED\"] = \"hlsLevelsUpdated\";\n Events[\"AUDIO_TRACKS_UPDATED\"] = \"hlsAudioTracksUpdated\";\n Events[\"AUDIO_TRACK_SWITCHING\"] = \"hlsAudioTrackSwitching\";\n Events[\"AUDIO_TRACK_SWITCHED\"] = \"hlsAudioTrackSwitched\";\n Events[\"AUDIO_TRACK_LOADING\"] = \"hlsAudioTrackLoading\";\n Events[\"AUDIO_TRACK_LOADED\"] = \"hlsAudioTrackLoaded\";\n Events[\"SUBTITLE_TRACKS_UPDATED\"] = \"hlsSubtitleTracksUpdated\";\n Events[\"SUBTITLE_TRACKS_CLEARED\"] = \"hlsSubtitleTracksCleared\";\n Events[\"SUBTITLE_TRACK_SWITCH\"] = \"hlsSubtitleTrackSwitch\";\n Events[\"SUBTITLE_TRACK_LOADING\"] = \"hlsSubtitleTrackLoading\";\n Events[\"SUBTITLE_TRACK_LOADED\"] = \"hlsSubtitleTrackLoaded\";\n Events[\"SUBTITLE_FRAG_PROCESSED\"] = \"hlsSubtitleFragProcessed\";\n Events[\"CUES_PARSED\"] = \"hlsCuesParsed\";\n Events[\"NON_NATIVE_TEXT_TRACKS_FOUND\"] = \"hlsNonNativeTextTracksFound\";\n Events[\"INIT_PTS_FOUND\"] = \"hlsInitPtsFound\";\n Events[\"FRAG_LOADING\"] = \"hlsFragLoading\";\n Events[\"FRAG_LOAD_EMERGENCY_ABORTED\"] = \"hlsFragLoadEmergencyAborted\";\n Events[\"FRAG_LOADED\"] = \"hlsFragLoaded\";\n Events[\"FRAG_DECRYPTED\"] = \"hlsFragDecrypted\";\n Events[\"FRAG_PARSING_INIT_SEGMENT\"] = \"hlsFragParsingInitSegment\";\n Events[\"FRAG_PARSING_USERDATA\"] = \"hlsFragParsingUserdata\";\n Events[\"FRAG_PARSING_METADATA\"] = \"hlsFragParsingMetadata\";\n Events[\"FRAG_PARSED\"] = \"hlsFragParsed\";\n Events[\"FRAG_BUFFERED\"] = \"hlsFragBuffered\";\n Events[\"FRAG_CHANGED\"] = \"hlsFragChanged\";\n Events[\"FPS_DROP\"] = \"hlsFpsDrop\";\n Events[\"FPS_DROP_LEVEL_CAPPING\"] = \"hlsFpsDropLevelCapping\";\n Events[\"ERROR\"] = \"hlsError\";\n Events[\"DESTROYING\"] = \"hlsDestroying\";\n Events[\"KEY_LOADING\"] = \"hlsKeyLoading\";\n Events[\"KEY_LOADED\"] = \"hlsKeyLoaded\";\n Events[\"LIVE_BACK_BUFFER_REACHED\"] = \"hlsLiveBackBufferReached\";\n Events[\"BACK_BUFFER_REACHED\"] = \"hlsBackBufferReached\";\n})(Events || (Events = {}));\n\n/***/ }),\n\n/***/ \"./src/hls.ts\":\n/*!********************!*\\\n !*** ./src/hls.ts ***!\n \\********************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Hls)\n/* harmony export */ });\n/* harmony import */ var url_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! url-toolkit */ \"./node_modules/url-toolkit/src/url-toolkit.js\");\n/* harmony import */ var url_toolkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(url_toolkit__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _loader_playlist_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./loader/playlist-loader */ \"./src/loader/playlist-loader.ts\");\n/* harmony import */ var _controller_id3_track_controller__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./controller/id3-track-controller */ \"./src/controller/id3-track-controller.ts\");\n/* harmony import */ var _controller_latency_controller__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./controller/latency-controller */ \"./src/controller/latency-controller.ts\");\n/* harmony import */ var _controller_level_controller__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./controller/level-controller */ \"./src/controller/level-controller.ts\");\n/* harmony import */ var _controller_fragment_tracker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./controller/fragment-tracker */ \"./src/controller/fragment-tracker.ts\");\n/* harmony import */ var _loader_key_loader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./loader/key-loader */ \"./src/loader/key-loader.ts\");\n/* harmony import */ var _controller_stream_controller__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./controller/stream-controller */ \"./src/controller/stream-controller.ts\");\n/* harmony import */ var _is_supported__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./is-supported */ \"./src/is-supported.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./config */ \"./src/config.ts\");\n/* harmony import */ var eventemitter3__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\");\n/* harmony import */ var eventemitter3__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(eventemitter3__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./events */ \"./src/events.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./errors */ \"./src/errors.ts\");\n/* harmony import */ var _types_level__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./types/level */ \"./src/types/level.ts\");\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @module Hls\n * @class\n * @constructor\n */\nvar Hls = /*#__PURE__*/function () {\n Hls.isSupported = function isSupported() {\n return (0,_is_supported__WEBPACK_IMPORTED_MODULE_8__.isSupported)();\n };\n /**\n * Creates an instance of an HLS client that can attach to exactly one `HTMLMediaElement`.\n *\n * @constructs Hls\n * @param {HlsConfig} config\n */\n function Hls(userConfig) {\n if (userConfig === void 0) {\n userConfig = {};\n }\n this.config = void 0;\n this.userConfig = void 0;\n this.coreComponents = void 0;\n this.networkControllers = void 0;\n this._emitter = new eventemitter3__WEBPACK_IMPORTED_MODULE_11__.EventEmitter();\n this._autoLevelCapping = void 0;\n this._maxHdcpLevel = null;\n this.abrController = void 0;\n this.bufferController = void 0;\n this.capLevelController = void 0;\n this.latencyController = void 0;\n this.levelController = void 0;\n this.streamController = void 0;\n this.audioTrackController = void 0;\n this.subtitleTrackController = void 0;\n this.emeController = void 0;\n this.cmcdController = void 0;\n this._media = null;\n this.url = null;\n var config = this.config = (0,_config__WEBPACK_IMPORTED_MODULE_10__.mergeConfig)(Hls.DefaultConfig, userConfig);\n this.userConfig = userConfig;\n (0,_utils_logger__WEBPACK_IMPORTED_MODULE_9__.enableLogs)(config.debug, 'Hls instance');\n this._autoLevelCapping = -1;\n if (config.progressive) {\n (0,_config__WEBPACK_IMPORTED_MODULE_10__.enableStreamingMode)(config);\n }\n\n // core controllers and network loaders\n var ConfigAbrController = config.abrController,\n ConfigBufferController = config.bufferController,\n ConfigCapLevelController = config.capLevelController,\n ConfigFpsController = config.fpsController;\n var abrController = this.abrController = new ConfigAbrController(this);\n var bufferController = this.bufferController = new ConfigBufferController(this);\n var capLevelController = this.capLevelController = new ConfigCapLevelController(this);\n var fpsController = new ConfigFpsController(this);\n var playListLoader = new _loader_playlist_loader__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this);\n var id3TrackController = new _controller_id3_track_controller__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this);\n\n // network controllers\n var levelController = this.levelController = new _controller_level_controller__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this);\n // FragmentTracker must be defined before StreamController because the order of event handling is important\n var fragmentTracker = new _controller_fragment_tracker__WEBPACK_IMPORTED_MODULE_5__.FragmentTracker(this);\n var keyLoader = new _loader_key_loader__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this.config);\n var streamController = this.streamController = new _controller_stream_controller__WEBPACK_IMPORTED_MODULE_7__[\"default\"](this, fragmentTracker, keyLoader);\n\n // Cap level controller uses streamController to flush the buffer\n capLevelController.setStreamController(streamController);\n // fpsController uses streamController to switch when frames are being dropped\n fpsController.setStreamController(streamController);\n var networkControllers = [playListLoader, levelController, streamController];\n this.networkControllers = networkControllers;\n var coreComponents = [abrController, bufferController, capLevelController, fpsController, id3TrackController, fragmentTracker];\n this.audioTrackController = this.createController(config.audioTrackController, networkControllers);\n var AudioStreamControllerClass = config.audioStreamController;\n if (AudioStreamControllerClass) {\n networkControllers.push(new AudioStreamControllerClass(this, fragmentTracker, keyLoader));\n }\n // subtitleTrackController must be defined before subtitleStreamController because the order of event handling is important\n this.subtitleTrackController = this.createController(config.subtitleTrackController, networkControllers);\n var SubtitleStreamControllerClass = config.subtitleStreamController;\n if (SubtitleStreamControllerClass) {\n networkControllers.push(new SubtitleStreamControllerClass(this, fragmentTracker, keyLoader));\n }\n this.createController(config.timelineController, coreComponents);\n keyLoader.emeController = this.emeController = this.createController(config.emeController, coreComponents);\n this.cmcdController = this.createController(config.cmcdController, coreComponents);\n this.latencyController = this.createController(_controller_latency_controller__WEBPACK_IMPORTED_MODULE_3__[\"default\"], coreComponents);\n this.coreComponents = coreComponents;\n }\n var _proto = Hls.prototype;\n _proto.createController = function createController(ControllerClass, components) {\n if (ControllerClass) {\n var controllerInstance = new ControllerClass(this);\n if (components) {\n components.push(controllerInstance);\n }\n return controllerInstance;\n }\n return null;\n }\n\n // Delegate the EventEmitter through the public API of Hls.js\n ;\n _proto.on = function on(event, listener, context) {\n if (context === void 0) {\n context = this;\n }\n this._emitter.on(event, listener, context);\n };\n _proto.once = function once(event, listener, context) {\n if (context === void 0) {\n context = this;\n }\n this._emitter.once(event, listener, context);\n };\n _proto.removeAllListeners = function removeAllListeners(event) {\n this._emitter.removeAllListeners(event);\n };\n _proto.off = function off(event, listener, context, once) {\n if (context === void 0) {\n context = this;\n }\n this._emitter.off(event, listener, context, once);\n };\n _proto.listeners = function listeners(event) {\n return this._emitter.listeners(event);\n };\n _proto.emit = function emit(event, name, eventObject) {\n return this._emitter.emit(event, name, eventObject);\n };\n _proto.trigger = function trigger(event, eventObject) {\n if (this.config.debug) {\n return this.emit(event, event, eventObject);\n } else {\n try {\n return this.emit(event, event, eventObject);\n } catch (e) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.error('An internal error happened while handling event ' + event + '. Error message: \"' + e.message + '\". Here is a stacktrace:', e);\n this.trigger(_events__WEBPACK_IMPORTED_MODULE_12__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_13__.ErrorTypes.OTHER_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_13__.ErrorDetails.INTERNAL_EXCEPTION,\n fatal: false,\n event: event,\n error: e\n });\n }\n }\n return false;\n };\n _proto.listenerCount = function listenerCount(event) {\n return this._emitter.listenerCount(event);\n }\n\n /**\n * Dispose of the instance\n */;\n _proto.destroy = function destroy() {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log('destroy');\n this.trigger(_events__WEBPACK_IMPORTED_MODULE_12__.Events.DESTROYING, undefined);\n this.detachMedia();\n this.removeAllListeners();\n this._autoLevelCapping = -1;\n this.url = null;\n this.networkControllers.forEach(function (component) {\n return component.destroy();\n });\n this.networkControllers.length = 0;\n this.coreComponents.forEach(function (component) {\n return component.destroy();\n });\n this.coreComponents.length = 0;\n }\n\n /**\n * Attaches Hls.js to a media element\n * @param {HTMLMediaElement} media\n */;\n _proto.attachMedia = function attachMedia(media) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log('attachMedia');\n this._media = media;\n this.trigger(_events__WEBPACK_IMPORTED_MODULE_12__.Events.MEDIA_ATTACHING, {\n media: media\n });\n }\n\n /**\n * Detach Hls.js from the media\n */;\n _proto.detachMedia = function detachMedia() {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log('detachMedia');\n this.trigger(_events__WEBPACK_IMPORTED_MODULE_12__.Events.MEDIA_DETACHING, undefined);\n this._media = null;\n }\n\n /**\n * Set the source URL. Can be relative or absolute.\n * @param {string} url\n */;\n _proto.loadSource = function loadSource(url) {\n this.stopLoad();\n var media = this.media;\n var loadedSource = this.url;\n var loadingSource = this.url = url_toolkit__WEBPACK_IMPORTED_MODULE_0__.buildAbsoluteURL(self.location.href, url, {\n alwaysNormalize: true\n });\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log(\"loadSource:\" + loadingSource);\n if (media && loadedSource && loadedSource !== loadingSource && this.bufferController.hasSourceTypes()) {\n this.detachMedia();\n this.attachMedia(media);\n }\n // when attaching to a source URL, trigger a playlist load\n this.trigger(_events__WEBPACK_IMPORTED_MODULE_12__.Events.MANIFEST_LOADING, {\n url: url\n });\n }\n\n /**\n * Start loading data from the stream source.\n * Depending on default config, client starts loading automatically when a source is set.\n *\n * @param {number} startPosition Set the start position to stream from\n * @default -1 None (from earliest point)\n */;\n _proto.startLoad = function startLoad(startPosition) {\n if (startPosition === void 0) {\n startPosition = -1;\n }\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log(\"startLoad(\" + startPosition + \")\");\n this.networkControllers.forEach(function (controller) {\n controller.startLoad(startPosition);\n });\n }\n\n /**\n * Stop loading of any stream data.\n */;\n _proto.stopLoad = function stopLoad() {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log('stopLoad');\n this.networkControllers.forEach(function (controller) {\n controller.stopLoad();\n });\n }\n\n /**\n * Swap through possible audio codecs in the stream (for example to switch from stereo to 5.1)\n */;\n _proto.swapAudioCodec = function swapAudioCodec() {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log('swapAudioCodec');\n this.streamController.swapAudioCodec();\n }\n\n /**\n * When the media-element fails, this allows to detach and then re-attach it\n * as one call (convenience method).\n *\n * Automatic recovery of media-errors by this process is configurable.\n */;\n _proto.recoverMediaError = function recoverMediaError() {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log('recoverMediaError');\n var media = this._media;\n this.detachMedia();\n if (media) {\n this.attachMedia(media);\n }\n };\n _proto.removeLevel = function removeLevel(levelIndex, urlId) {\n if (urlId === void 0) {\n urlId = 0;\n }\n this.levelController.removeLevel(levelIndex, urlId);\n }\n\n /**\n * @type {Level[]}\n */;\n _createClass(Hls, [{\n key: \"levels\",\n get: function get() {\n var levels = this.levelController.levels;\n return levels ? levels : [];\n }\n\n /**\n * Index of quality level currently played\n * @type {number}\n */\n }, {\n key: \"currentLevel\",\n get: function get() {\n return this.streamController.currentLevel;\n }\n\n /**\n * Set quality level index immediately .\n * This will flush the current buffer to replace the quality asap.\n * That means playback will interrupt at least shortly to re-buffer and re-sync eventually.\n * @type {number} -1 for automatic level selection\n */,\n set: function set(newLevel) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log(\"set currentLevel:\" + newLevel);\n this.loadLevel = newLevel;\n this.abrController.clearTimer();\n this.streamController.immediateLevelSwitch();\n }\n\n /**\n * Index of next quality level loaded as scheduled by stream controller.\n * @type {number}\n */\n }, {\n key: \"nextLevel\",\n get: function get() {\n return this.streamController.nextLevel;\n }\n\n /**\n * Set quality level index for next loaded data.\n * This will switch the video quality asap, without interrupting playback.\n * May abort current loading of data, and flush parts of buffer (outside currently played fragment region).\n * @type {number} -1 for automatic level selection\n */,\n set: function set(newLevel) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log(\"set nextLevel:\" + newLevel);\n this.levelController.manualLevel = newLevel;\n this.streamController.nextLevelSwitch();\n }\n\n /**\n * Return the quality level of the currently or last (of none is loaded currently) segment\n * @type {number}\n */\n }, {\n key: \"loadLevel\",\n get: function get() {\n return this.levelController.level;\n }\n\n /**\n * Set quality level index for next loaded data in a conservative way.\n * This will switch the quality without flushing, but interrupt current loading.\n * Thus the moment when the quality switch will appear in effect will only be after the already existing buffer.\n * @type {number} newLevel -1 for automatic level selection\n */,\n set: function set(newLevel) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log(\"set loadLevel:\" + newLevel);\n this.levelController.manualLevel = newLevel;\n }\n\n /**\n * get next quality level loaded\n * @type {number}\n */\n }, {\n key: \"nextLoadLevel\",\n get: function get() {\n return this.levelController.nextLoadLevel;\n }\n\n /**\n * Set quality level of next loaded segment in a fully \"non-destructive\" way.\n * Same as `loadLevel` but will wait for next switch (until current loading is done).\n * @type {number} level\n */,\n set: function set(level) {\n this.levelController.nextLoadLevel = level;\n }\n\n /**\n * Return \"first level\": like a default level, if not set,\n * falls back to index of first level referenced in manifest\n * @type {number}\n */\n }, {\n key: \"firstLevel\",\n get: function get() {\n return Math.max(this.levelController.firstLevel, this.minAutoLevel);\n }\n\n /**\n * Sets \"first-level\", see getter.\n * @type {number}\n */,\n set: function set(newLevel) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log(\"set firstLevel:\" + newLevel);\n this.levelController.firstLevel = newLevel;\n }\n\n /**\n * Return start level (level of first fragment that will be played back)\n * if not overrided by user, first level appearing in manifest will be used as start level\n * if -1 : automatic start level selection, playback will start from level matching download bandwidth\n * (determined from download of first segment)\n * @type {number}\n */\n }, {\n key: \"startLevel\",\n get: function get() {\n return this.levelController.startLevel;\n }\n\n /**\n * set start level (level of first fragment that will be played back)\n * if not overrided by user, first level appearing in manifest will be used as start level\n * if -1 : automatic start level selection, playback will start from level matching download bandwidth\n * (determined from download of first segment)\n * @type {number} newLevel\n */,\n set: function set(newLevel) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log(\"set startLevel:\" + newLevel);\n // if not in automatic start level detection, ensure startLevel is greater than minAutoLevel\n if (newLevel !== -1) {\n newLevel = Math.max(newLevel, this.minAutoLevel);\n }\n this.levelController.startLevel = newLevel;\n }\n\n /**\n * Get the current setting for capLevelToPlayerSize\n *\n * @type {boolean}\n */\n }, {\n key: \"capLevelToPlayerSize\",\n get: function get() {\n return this.config.capLevelToPlayerSize;\n }\n\n /**\n * set dynamically set capLevelToPlayerSize against (`CapLevelController`)\n *\n * @type {boolean}\n */,\n set: function set(shouldStartCapping) {\n var newCapLevelToPlayerSize = !!shouldStartCapping;\n if (newCapLevelToPlayerSize !== this.config.capLevelToPlayerSize) {\n if (newCapLevelToPlayerSize) {\n this.capLevelController.startCapping(); // If capping occurs, nextLevelSwitch will happen based on size.\n } else {\n this.capLevelController.stopCapping();\n this.autoLevelCapping = -1;\n this.streamController.nextLevelSwitch(); // Now we're uncapped, get the next level asap.\n }\n\n this.config.capLevelToPlayerSize = newCapLevelToPlayerSize;\n }\n }\n\n /**\n * Capping/max level value that should be used by automatic level selection algorithm (`ABRController`)\n * @type {number}\n */\n }, {\n key: \"autoLevelCapping\",\n get: function get() {\n return this._autoLevelCapping;\n }\n\n /**\n * get bandwidth estimate\n * @type {number}\n */,\n set:\n /**\n * Capping/max level value that should be used by automatic level selection algorithm (`ABRController`)\n * @type {number}\n */\n function set(newLevel) {\n if (this._autoLevelCapping !== newLevel) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_9__.logger.log(\"set autoLevelCapping:\" + newLevel);\n this._autoLevelCapping = newLevel;\n }\n }\n }, {\n key: \"bandwidthEstimate\",\n get: function get() {\n var bwEstimator = this.abrController.bwEstimator;\n if (!bwEstimator) {\n return NaN;\n }\n return bwEstimator.getEstimate();\n }\n }, {\n key: \"maxHdcpLevel\",\n get: function get() {\n return this._maxHdcpLevel;\n },\n set: function set(value) {\n if (_types_level__WEBPACK_IMPORTED_MODULE_14__.HdcpLevels.indexOf(value) > -1) {\n this._maxHdcpLevel = value;\n }\n }\n\n /**\n * True when automatic level selection enabled\n * @type {boolean}\n */\n }, {\n key: \"autoLevelEnabled\",\n get: function get() {\n return this.levelController.manualLevel === -1;\n }\n\n /**\n * Level set manually (if any)\n * @type {number}\n */\n }, {\n key: \"manualLevel\",\n get: function get() {\n return this.levelController.manualLevel;\n }\n\n /**\n * min level selectable in auto mode according to config.minAutoBitrate\n * @type {number}\n */\n }, {\n key: \"minAutoLevel\",\n get: function get() {\n var levels = this.levels,\n minAutoBitrate = this.config.minAutoBitrate;\n if (!levels) return 0;\n var len = levels.length;\n for (var i = 0; i < len; i++) {\n if (levels[i].maxBitrate >= minAutoBitrate) {\n return i;\n }\n }\n return 0;\n }\n\n /**\n * max level selectable in auto mode according to autoLevelCapping\n * @type {number}\n */\n }, {\n key: \"maxAutoLevel\",\n get: function get() {\n var levels = this.levels,\n autoLevelCapping = this.autoLevelCapping,\n maxHdcpLevel = this.maxHdcpLevel;\n var maxAutoLevel;\n if (autoLevelCapping === -1 && levels && levels.length) {\n maxAutoLevel = levels.length - 1;\n } else {\n maxAutoLevel = autoLevelCapping;\n }\n if (maxHdcpLevel) {\n for (var i = maxAutoLevel; i--;) {\n var hdcpLevel = levels[i].attrs['HDCP-LEVEL'];\n if (hdcpLevel && hdcpLevel <= maxHdcpLevel) {\n return i;\n }\n }\n }\n return maxAutoLevel;\n }\n\n /**\n * next automatically selected quality level\n * @type {number}\n */\n }, {\n key: \"nextAutoLevel\",\n get: function get() {\n // ensure next auto level is between min and max auto level\n return Math.min(Math.max(this.abrController.nextAutoLevel, this.minAutoLevel), this.maxAutoLevel);\n }\n\n /**\n * this setter is used to force next auto level.\n * this is useful to force a switch down in auto mode:\n * in case of load error on level N, hls.js can set nextAutoLevel to N-1 for example)\n * forced value is valid for one fragment. upon successful frag loading at forced level,\n * this value will be resetted to -1 by ABR controller.\n * @type {number}\n */,\n set: function set(nextLevel) {\n this.abrController.nextAutoLevel = Math.max(this.minAutoLevel, nextLevel);\n }\n\n /**\n * get the datetime value relative to media.currentTime for the active level Program Date Time if present\n * @type {Date}\n */\n }, {\n key: \"playingDate\",\n get: function get() {\n return this.streamController.currentProgramDateTime;\n }\n }, {\n key: \"mainForwardBufferInfo\",\n get: function get() {\n return this.streamController.getMainFwdBufferInfo();\n }\n\n /**\n * @type {AudioTrack[]}\n */\n }, {\n key: \"audioTracks\",\n get: function get() {\n var audioTrackController = this.audioTrackController;\n return audioTrackController ? audioTrackController.audioTracks : [];\n }\n\n /**\n * index of the selected audio track (index in audio track lists)\n * @type {number}\n */\n }, {\n key: \"audioTrack\",\n get: function get() {\n var audioTrackController = this.audioTrackController;\n return audioTrackController ? audioTrackController.audioTrack : -1;\n }\n\n /**\n * selects an audio track, based on its index in audio track lists\n * @type {number}\n */,\n set: function set(audioTrackId) {\n var audioTrackController = this.audioTrackController;\n if (audioTrackController) {\n audioTrackController.audioTrack = audioTrackId;\n }\n }\n\n /**\n * get alternate subtitle tracks list from playlist\n * @type {MediaPlaylist[]}\n */\n }, {\n key: \"subtitleTracks\",\n get: function get() {\n var subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTracks : [];\n }\n\n /**\n * index of the selected subtitle track (index in subtitle track lists)\n * @type {number}\n */\n }, {\n key: \"subtitleTrack\",\n get: function get() {\n var subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTrack : -1;\n },\n set:\n /**\n * select an subtitle track, based on its index in subtitle track lists\n * @type {number}\n */\n function set(subtitleTrackId) {\n var subtitleTrackController = this.subtitleTrackController;\n if (subtitleTrackController) {\n subtitleTrackController.subtitleTrack = subtitleTrackId;\n }\n }\n\n /**\n * @type {boolean}\n */\n }, {\n key: \"media\",\n get: function get() {\n return this._media;\n }\n }, {\n key: \"subtitleDisplay\",\n get: function get() {\n var subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleDisplay : false;\n }\n\n /**\n * Enable/disable subtitle display rendering\n * @type {boolean}\n */,\n set: function set(value) {\n var subtitleTrackController = this.subtitleTrackController;\n if (subtitleTrackController) {\n subtitleTrackController.subtitleDisplay = value;\n }\n }\n\n /**\n * get mode for Low-Latency HLS loading\n * @type {boolean}\n */\n }, {\n key: \"lowLatencyMode\",\n get: function get() {\n return this.config.lowLatencyMode;\n }\n\n /**\n * Enable/disable Low-Latency HLS part playlist and segment loading, and start live streams at playlist PART-HOLD-BACK rather than HOLD-BACK.\n * @type {boolean}\n */,\n set: function set(mode) {\n this.config.lowLatencyMode = mode;\n }\n\n /**\n * position (in seconds) of live sync point (ie edge of live position minus safety delay defined by ```hls.config.liveSyncDuration```)\n * @type {number}\n */\n }, {\n key: \"liveSyncPosition\",\n get: function get() {\n return this.latencyController.liveSyncPosition;\n }\n\n /**\n * estimated position (in seconds) of live edge (ie edge of live playlist plus time sync playlist advanced)\n * returns 0 before first playlist is loaded\n * @type {number}\n */\n }, {\n key: \"latency\",\n get: function get() {\n return this.latencyController.latency;\n }\n\n /**\n * maximum distance from the edge before the player seeks forward to ```hls.liveSyncPosition```\n * configured using ```liveMaxLatencyDurationCount``` (multiple of target duration) or ```liveMaxLatencyDuration```\n * returns 0 before first playlist is loaded\n * @type {number}\n */\n }, {\n key: \"maxLatency\",\n get: function get() {\n return this.latencyController.maxLatency;\n }\n\n /**\n * target distance from the edge as calculated by the latency controller\n * @type {number}\n */\n }, {\n key: \"targetLatency\",\n get: function get() {\n return this.latencyController.targetLatency;\n }\n\n /**\n * the rate at which the edge of the current live playlist is advancing or 1 if there is none\n * @type {number}\n */\n }, {\n key: \"drift\",\n get: function get() {\n return this.latencyController.drift;\n }\n\n /**\n * set to true when startLoad is called before MANIFEST_PARSED event\n * @type {boolean}\n */\n }, {\n key: \"forceStartLoad\",\n get: function get() {\n return this.streamController.forceStartLoad;\n }\n }], [{\n key: \"version\",\n get: function get() {\n return \"1.3.5\";\n }\n }, {\n key: \"Events\",\n get: function get() {\n return _events__WEBPACK_IMPORTED_MODULE_12__.Events;\n }\n }, {\n key: \"ErrorTypes\",\n get: function get() {\n return _errors__WEBPACK_IMPORTED_MODULE_13__.ErrorTypes;\n }\n }, {\n key: \"ErrorDetails\",\n get: function get() {\n return _errors__WEBPACK_IMPORTED_MODULE_13__.ErrorDetails;\n }\n }, {\n key: \"DefaultConfig\",\n get: function get() {\n if (!Hls.defaultConfig) {\n return _config__WEBPACK_IMPORTED_MODULE_10__.hlsDefaultConfig;\n }\n return Hls.defaultConfig;\n }\n\n /**\n * @type {HlsConfig}\n */,\n set: function set(defaultConfig) {\n Hls.defaultConfig = defaultConfig;\n }\n }]);\n return Hls;\n}();\nHls.defaultConfig = void 0;\n\n\n/***/ }),\n\n/***/ \"./src/is-supported.ts\":\n/*!*****************************!*\\\n !*** ./src/is-supported.ts ***!\n \\*****************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"changeTypeSupported\": () => (/* binding */ changeTypeSupported),\n/* harmony export */ \"isSupported\": () => (/* binding */ isSupported)\n/* harmony export */ });\n/* harmony import */ var _utils_mediasource_helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/mediasource-helper */ \"./src/utils/mediasource-helper.ts\");\n\nfunction getSourceBuffer() {\n return self.SourceBuffer || self.WebKitSourceBuffer;\n}\nfunction isSupported() {\n var mediaSource = (0,_utils_mediasource_helper__WEBPACK_IMPORTED_MODULE_0__.getMediaSource)();\n if (!mediaSource) {\n return false;\n }\n var sourceBuffer = getSourceBuffer();\n var isTypeSupported = mediaSource && typeof mediaSource.isTypeSupported === 'function' && mediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n\n // if SourceBuffer is exposed ensure its API is valid\n // safari and old version of Chrome doe not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible\n var sourceBufferValidAPI = !sourceBuffer || sourceBuffer.prototype && typeof sourceBuffer.prototype.appendBuffer === 'function' && typeof sourceBuffer.prototype.remove === 'function';\n return !!isTypeSupported && !!sourceBufferValidAPI;\n}\nfunction changeTypeSupported() {\n var _sourceBuffer$prototy;\n var sourceBuffer = getSourceBuffer();\n return typeof (sourceBuffer === null || sourceBuffer === void 0 ? void 0 : (_sourceBuffer$prototy = sourceBuffer.prototype) === null || _sourceBuffer$prototy === void 0 ? void 0 : _sourceBuffer$prototy.changeType) === 'function';\n}\n\n/***/ }),\n\n/***/ \"./src/loader/date-range.ts\":\n/*!**********************************!*\\\n !*** ./src/loader/date-range.ts ***!\n \\**********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DateRange\": () => (/* binding */ DateRange),\n/* harmony export */ \"DateRangeAttribute\": () => (/* binding */ DateRangeAttribute)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _utils_attr_list__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/attr-list */ \"./src/utils/attr-list.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n\n\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\nvar DateRangeAttribute;\n(function (DateRangeAttribute) {\n DateRangeAttribute[\"ID\"] = \"ID\";\n DateRangeAttribute[\"CLASS\"] = \"CLASS\";\n DateRangeAttribute[\"START_DATE\"] = \"START-DATE\";\n DateRangeAttribute[\"DURATION\"] = \"DURATION\";\n DateRangeAttribute[\"END_DATE\"] = \"END-DATE\";\n DateRangeAttribute[\"END_ON_NEXT\"] = \"END-ON-NEXT\";\n DateRangeAttribute[\"PLANNED_DURATION\"] = \"PLANNED-DURATION\";\n DateRangeAttribute[\"SCTE35_OUT\"] = \"SCTE35-OUT\";\n DateRangeAttribute[\"SCTE35_IN\"] = \"SCTE35-IN\";\n})(DateRangeAttribute || (DateRangeAttribute = {}));\nvar DateRange = /*#__PURE__*/function () {\n function DateRange(dateRangeAttr, dateRangeWithSameId) {\n this.attr = void 0;\n this._startDate = void 0;\n this._endDate = void 0;\n this._badValueForSameId = void 0;\n if (dateRangeWithSameId) {\n var previousAttr = dateRangeWithSameId.attr;\n for (var key in previousAttr) {\n if (Object.prototype.hasOwnProperty.call(dateRangeAttr, key) && dateRangeAttr[key] !== previousAttr[key]) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_2__.logger.warn(\"DATERANGE tag attribute: \\\"\" + key + \"\\\" does not match for tags with ID: \\\"\" + dateRangeAttr.ID + \"\\\"\");\n this._badValueForSameId = key;\n break;\n }\n }\n // Merge DateRange tags with the same ID\n dateRangeAttr = _extends(new _utils_attr_list__WEBPACK_IMPORTED_MODULE_1__.AttrList({}), previousAttr, dateRangeAttr);\n }\n this.attr = dateRangeAttr;\n this._startDate = new Date(dateRangeAttr[DateRangeAttribute.START_DATE]);\n if (DateRangeAttribute.END_DATE in this.attr) {\n var endDate = new Date(this.attr[DateRangeAttribute.END_DATE]);\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(endDate.getTime())) {\n this._endDate = endDate;\n }\n }\n }\n _createClass(DateRange, [{\n key: \"id\",\n get: function get() {\n return this.attr.ID;\n }\n }, {\n key: \"class\",\n get: function get() {\n return this.attr.CLASS;\n }\n }, {\n key: \"startDate\",\n get: function get() {\n return this._startDate;\n }\n }, {\n key: \"endDate\",\n get: function get() {\n if (this._endDate) {\n return this._endDate;\n }\n var duration = this.duration;\n if (duration !== null) {\n return new Date(this._startDate.getTime() + duration * 1000);\n }\n return null;\n }\n }, {\n key: \"duration\",\n get: function get() {\n if (DateRangeAttribute.DURATION in this.attr) {\n var duration = this.attr.decimalFloatingPoint(DateRangeAttribute.DURATION);\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(duration)) {\n return duration;\n }\n } else if (this._endDate) {\n return (this._endDate.getTime() - this._startDate.getTime()) / 1000;\n }\n return null;\n }\n }, {\n key: \"plannedDuration\",\n get: function get() {\n if (DateRangeAttribute.PLANNED_DURATION in this.attr) {\n return this.attr.decimalFloatingPoint(DateRangeAttribute.PLANNED_DURATION);\n }\n return null;\n }\n }, {\n key: \"endOnNext\",\n get: function get() {\n return this.attr.bool(DateRangeAttribute.END_ON_NEXT);\n }\n }, {\n key: \"isValid\",\n get: function get() {\n return !!this.id && !this._badValueForSameId && (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(this.startDate.getTime()) && (this.duration === null || this.duration >= 0) && (!this.endOnNext || !!this.class);\n }\n }]);\n return DateRange;\n}();\n\n/***/ }),\n\n/***/ \"./src/loader/fragment-loader.ts\":\n/*!***************************************!*\\\n !*** ./src/loader/fragment-loader.ts ***!\n \\***************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"LoadError\": () => (/* binding */ LoadError),\n/* harmony export */ \"default\": () => (/* binding */ FragmentLoader)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar MIN_CHUNK_SIZE = Math.pow(2, 17); // 128kb\nvar FragmentLoader = /*#__PURE__*/function () {\n function FragmentLoader(config) {\n this.config = void 0;\n this.loader = null;\n this.partLoadTimeout = -1;\n this.config = config;\n }\n var _proto = FragmentLoader.prototype;\n _proto.destroy = function destroy() {\n if (this.loader) {\n this.loader.destroy();\n this.loader = null;\n }\n };\n _proto.abort = function abort() {\n if (this.loader) {\n // Abort the loader for current fragment. Only one may load at any given time\n this.loader.abort();\n }\n };\n _proto.load = function load(frag, _onProgress) {\n var _this = this;\n var url = frag.url;\n if (!url) {\n return Promise.reject(new LoadError({\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.NETWORK_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.FRAG_LOAD_ERROR,\n fatal: false,\n frag: frag,\n networkDetails: null\n }, \"Fragment does not have a \" + (url ? 'part list' : 'url')));\n }\n this.abort();\n var config = this.config;\n var FragmentILoader = config.fLoader;\n var DefaultILoader = config.loader;\n return new Promise(function (resolve, reject) {\n if (_this.loader) {\n _this.loader.destroy();\n }\n var loader = _this.loader = frag.loader = FragmentILoader ? new FragmentILoader(config) : new DefaultILoader(config);\n var loaderContext = createLoaderContext(frag);\n var loaderConfig = {\n timeout: config.fragLoadingTimeOut,\n maxRetry: 0,\n retryDelay: 0,\n maxRetryDelay: config.fragLoadingMaxRetryTimeout,\n highWaterMark: frag.sn === 'initSegment' ? Infinity : MIN_CHUNK_SIZE\n };\n // Assign frag stats to the loader's stats reference\n frag.stats = loader.stats;\n loader.load(loaderContext, loaderConfig, {\n onSuccess: function onSuccess(response, stats, context, networkDetails) {\n _this.resetLoader(frag, loader);\n var payload = response.data;\n if (context.resetIV && frag.decryptdata) {\n frag.decryptdata.iv = new Uint8Array(payload.slice(0, 16));\n payload = payload.slice(16);\n }\n resolve({\n frag: frag,\n part: null,\n payload: payload,\n networkDetails: networkDetails\n });\n },\n onError: function onError(response, context, networkDetails) {\n _this.resetLoader(frag, loader);\n reject(new LoadError({\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.NETWORK_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.FRAG_LOAD_ERROR,\n fatal: false,\n frag: frag,\n response: response,\n networkDetails: networkDetails\n }));\n },\n onAbort: function onAbort(stats, context, networkDetails) {\n _this.resetLoader(frag, loader);\n reject(new LoadError({\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.NETWORK_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.INTERNAL_ABORTED,\n fatal: false,\n frag: frag,\n networkDetails: networkDetails\n }));\n },\n onTimeout: function onTimeout(response, context, networkDetails) {\n _this.resetLoader(frag, loader);\n reject(new LoadError({\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.NETWORK_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.FRAG_LOAD_TIMEOUT,\n fatal: false,\n frag: frag,\n networkDetails: networkDetails\n }));\n },\n onProgress: function onProgress(stats, context, data, networkDetails) {\n if (_onProgress) {\n _onProgress({\n frag: frag,\n part: null,\n payload: data,\n networkDetails: networkDetails\n });\n }\n }\n });\n });\n };\n _proto.loadPart = function loadPart(frag, part, onProgress) {\n var _this2 = this;\n this.abort();\n var config = this.config;\n var FragmentILoader = config.fLoader;\n var DefaultILoader = config.loader;\n return new Promise(function (resolve, reject) {\n if (_this2.loader) {\n _this2.loader.destroy();\n }\n var loader = _this2.loader = frag.loader = FragmentILoader ? new FragmentILoader(config) : new DefaultILoader(config);\n var loaderContext = createLoaderContext(frag, part);\n var loaderConfig = {\n timeout: config.fragLoadingTimeOut,\n maxRetry: 0,\n retryDelay: 0,\n maxRetryDelay: config.fragLoadingMaxRetryTimeout,\n highWaterMark: MIN_CHUNK_SIZE\n };\n // Assign part stats to the loader's stats reference\n part.stats = loader.stats;\n loader.load(loaderContext, loaderConfig, {\n onSuccess: function onSuccess(response, stats, context, networkDetails) {\n _this2.resetLoader(frag, loader);\n _this2.updateStatsFromPart(frag, part);\n var partLoadedData = {\n frag: frag,\n part: part,\n payload: response.data,\n networkDetails: networkDetails\n };\n onProgress(partLoadedData);\n resolve(partLoadedData);\n },\n onError: function onError(response, context, networkDetails) {\n _this2.resetLoader(frag, loader);\n reject(new LoadError({\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.NETWORK_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.FRAG_LOAD_ERROR,\n fatal: false,\n frag: frag,\n part: part,\n response: response,\n networkDetails: networkDetails\n }));\n },\n onAbort: function onAbort(stats, context, networkDetails) {\n frag.stats.aborted = part.stats.aborted;\n _this2.resetLoader(frag, loader);\n reject(new LoadError({\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.NETWORK_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.INTERNAL_ABORTED,\n fatal: false,\n frag: frag,\n part: part,\n networkDetails: networkDetails\n }));\n },\n onTimeout: function onTimeout(response, context, networkDetails) {\n _this2.resetLoader(frag, loader);\n reject(new LoadError({\n type: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorTypes.NETWORK_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_1__.ErrorDetails.FRAG_LOAD_TIMEOUT,\n fatal: false,\n frag: frag,\n part: part,\n networkDetails: networkDetails\n }));\n }\n });\n });\n };\n _proto.updateStatsFromPart = function updateStatsFromPart(frag, part) {\n var fragStats = frag.stats;\n var partStats = part.stats;\n var partTotal = partStats.total;\n fragStats.loaded += partStats.loaded;\n if (partTotal) {\n var estTotalParts = Math.round(frag.duration / part.duration);\n var estLoadedParts = Math.min(Math.round(fragStats.loaded / partTotal), estTotalParts);\n var estRemainingParts = estTotalParts - estLoadedParts;\n var estRemainingBytes = estRemainingParts * Math.round(fragStats.loaded / estLoadedParts);\n fragStats.total = fragStats.loaded + estRemainingBytes;\n } else {\n fragStats.total = Math.max(fragStats.loaded, fragStats.total);\n }\n var fragLoading = fragStats.loading;\n var partLoading = partStats.loading;\n if (fragLoading.start) {\n // add to fragment loader latency\n fragLoading.first += partLoading.first - partLoading.start;\n } else {\n fragLoading.start = partLoading.start;\n fragLoading.first = partLoading.first;\n }\n fragLoading.end = partLoading.end;\n };\n _proto.resetLoader = function resetLoader(frag, loader) {\n frag.loader = null;\n if (this.loader === loader) {\n self.clearTimeout(this.partLoadTimeout);\n this.loader = null;\n }\n loader.destroy();\n };\n return FragmentLoader;\n}();\n\nfunction createLoaderContext(frag, part) {\n if (part === void 0) {\n part = null;\n }\n var segment = part || frag;\n var loaderContext = {\n frag: frag,\n part: part,\n responseType: 'arraybuffer',\n url: segment.url,\n headers: {},\n rangeStart: 0,\n rangeEnd: 0\n };\n var start = segment.byteRangeStartOffset;\n var end = segment.byteRangeEndOffset;\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(start) && (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(end)) {\n var _frag$decryptdata;\n var byteRangeStart = start;\n var byteRangeEnd = end;\n if (frag.sn === 'initSegment' && ((_frag$decryptdata = frag.decryptdata) === null || _frag$decryptdata === void 0 ? void 0 : _frag$decryptdata.method) === 'AES-128') {\n // MAP segment encrypted with method 'AES-128', when served with HTTP Range,\n // has the unencrypted size specified in the range.\n // Ref: https://tools.ietf.org/html/draft-pantos-hls-rfc8216bis-08#section-6.3.6\n var fragmentLen = end - start;\n if (fragmentLen % 16) {\n byteRangeEnd = end + (16 - fragmentLen % 16);\n }\n if (start !== 0) {\n loaderContext.resetIV = true;\n byteRangeStart = start - 16;\n }\n }\n loaderContext.rangeStart = byteRangeStart;\n loaderContext.rangeEnd = byteRangeEnd;\n }\n return loaderContext;\n}\nvar LoadError = /*#__PURE__*/function (_Error) {\n _inheritsLoose(LoadError, _Error);\n function LoadError(data) {\n var _this3;\n for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n params[_key - 1] = arguments[_key];\n }\n _this3 = _Error.call.apply(_Error, [this].concat(params)) || this;\n _this3.data = void 0;\n _this3.data = data;\n return _this3;\n }\n return LoadError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\n/***/ }),\n\n/***/ \"./src/loader/fragment.ts\":\n/*!********************************!*\\\n !*** ./src/loader/fragment.ts ***!\n \\********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BaseSegment\": () => (/* binding */ BaseSegment),\n/* harmony export */ \"ElementaryStreamTypes\": () => (/* binding */ ElementaryStreamTypes),\n/* harmony export */ \"Fragment\": () => (/* binding */ Fragment),\n/* harmony export */ \"Part\": () => (/* binding */ Part)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var url_toolkit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! url-toolkit */ \"./node_modules/url-toolkit/src/url-toolkit.js\");\n/* harmony import */ var url_toolkit__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(url_toolkit__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _load_stats__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./load-stats */ \"./src/loader/load-stats.ts\");\n\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\nvar ElementaryStreamTypes;\n(function (ElementaryStreamTypes) {\n ElementaryStreamTypes[\"AUDIO\"] = \"audio\";\n ElementaryStreamTypes[\"VIDEO\"] = \"video\";\n ElementaryStreamTypes[\"AUDIOVIDEO\"] = \"audiovideo\";\n})(ElementaryStreamTypes || (ElementaryStreamTypes = {}));\nvar BaseSegment = /*#__PURE__*/function () {\n // baseurl is the URL to the playlist\n\n // relurl is the portion of the URL that comes from inside the playlist.\n\n // Holds the types of data this fragment supports\n\n function BaseSegment(baseurl) {\n var _this$elementaryStrea;\n this._byteRange = null;\n this._url = null;\n this.baseurl = void 0;\n this.relurl = void 0;\n this.elementaryStreams = (_this$elementaryStrea = {}, _this$elementaryStrea[ElementaryStreamTypes.AUDIO] = null, _this$elementaryStrea[ElementaryStreamTypes.VIDEO] = null, _this$elementaryStrea[ElementaryStreamTypes.AUDIOVIDEO] = null, _this$elementaryStrea);\n this.baseurl = baseurl;\n }\n\n // setByteRange converts a EXT-X-BYTERANGE attribute into a two element array\n var _proto = BaseSegment.prototype;\n _proto.setByteRange = function setByteRange(value, previous) {\n var params = value.split('@', 2);\n var byteRange = [];\n if (params.length === 1) {\n byteRange[0] = previous ? previous.byteRangeEndOffset : 0;\n } else {\n byteRange[0] = parseInt(params[1]);\n }\n byteRange[1] = parseInt(params[0]) + byteRange[0];\n this._byteRange = byteRange;\n };\n _createClass(BaseSegment, [{\n key: \"byteRange\",\n get: function get() {\n if (!this._byteRange) {\n return [];\n }\n return this._byteRange;\n }\n }, {\n key: \"byteRangeStartOffset\",\n get: function get() {\n return this.byteRange[0];\n }\n }, {\n key: \"byteRangeEndOffset\",\n get: function get() {\n return this.byteRange[1];\n }\n }, {\n key: \"url\",\n get: function get() {\n if (!this._url && this.baseurl && this.relurl) {\n this._url = (0,url_toolkit__WEBPACK_IMPORTED_MODULE_1__.buildAbsoluteURL)(this.baseurl, this.relurl, {\n alwaysNormalize: true\n });\n }\n return this._url || '';\n },\n set: function set(value) {\n this._url = value;\n }\n }]);\n return BaseSegment;\n}();\nvar Fragment = /*#__PURE__*/function (_BaseSegment) {\n _inheritsLoose(Fragment, _BaseSegment);\n // EXTINF has to be present for a m3u8 to be considered valid\n\n // sn notates the sequence number for a segment, and if set to a string can be 'initSegment'\n\n // levelkeys are the EXT-X-KEY tags that apply to this segment for decryption\n // core difference from the private field _decryptdata is the lack of the initialized IV\n // _decryptdata will set the IV for this segment based on the segment number in the fragment\n\n // A string representing the fragment type\n\n // A reference to the loader. Set while the fragment is loading, and removed afterwards. Used to abort fragment loading\n\n // A reference to the key loader. Set while the key is loading, and removed afterwards. Used to abort key loading\n\n // The level/track index to which the fragment belongs\n\n // The continuity counter of the fragment\n\n // The starting Presentation Time Stamp (PTS) of the fragment. Set after transmux complete.\n\n // The ending Presentation Time Stamp (PTS) of the fragment. Set after transmux complete.\n\n // The latest Presentation Time Stamp (PTS) appended to the buffer.\n\n // The starting Decode Time Stamp (DTS) of the fragment. Set after transmux complete.\n\n // The ending Decode Time Stamp (DTS) of the fragment. Set after transmux complete.\n\n // The start time of the fragment, as listed in the manifest. Updated after transmux complete.\n\n // Set by `updateFragPTSDTS` in level-helper\n\n // The maximum starting Presentation Time Stamp (audio/video PTS) of the fragment. Set after transmux complete.\n\n // The minimum ending Presentation Time Stamp (audio/video PTS) of the fragment. Set after transmux complete.\n\n // Load/parse timing information\n\n // A flag indicating whether the segment was downloaded in order to test bitrate, and was not buffered\n\n // #EXTINF segment title\n\n // The Media Initialization Section for this segment\n\n // Fragment is the last fragment in the media playlist\n\n function Fragment(type, baseurl) {\n var _this;\n _this = _BaseSegment.call(this, baseurl) || this;\n _this._decryptdata = null;\n _this.rawProgramDateTime = null;\n _this.programDateTime = null;\n _this.tagList = [];\n _this.duration = 0;\n _this.sn = 0;\n _this.levelkeys = void 0;\n _this.type = void 0;\n _this.loader = null;\n _this.keyLoader = null;\n _this.level = -1;\n _this.cc = 0;\n _this.startPTS = void 0;\n _this.endPTS = void 0;\n _this.appendedPTS = void 0;\n _this.startDTS = void 0;\n _this.endDTS = void 0;\n _this.start = 0;\n _this.deltaPTS = void 0;\n _this.maxStartPTS = void 0;\n _this.minEndPTS = void 0;\n _this.stats = new _load_stats__WEBPACK_IMPORTED_MODULE_2__.LoadStats();\n _this.urlId = 0;\n _this.data = void 0;\n _this.bitrateTest = false;\n _this.title = null;\n _this.initSegment = null;\n _this.endList = void 0;\n _this.type = type;\n return _this;\n }\n var _proto2 = Fragment.prototype;\n _proto2.setKeyFormat = function setKeyFormat(keyFormat) {\n if (this.levelkeys) {\n var _key = this.levelkeys[keyFormat];\n if (_key && !this._decryptdata) {\n this._decryptdata = _key.getDecryptData(this.sn);\n }\n }\n };\n _proto2.abortRequests = function abortRequests() {\n var _this$loader, _this$keyLoader;\n (_this$loader = this.loader) === null || _this$loader === void 0 ? void 0 : _this$loader.abort();\n (_this$keyLoader = this.keyLoader) === null || _this$keyLoader === void 0 ? void 0 : _this$keyLoader.abort();\n };\n _proto2.setElementaryStreamInfo = function setElementaryStreamInfo(type, startPTS, endPTS, startDTS, endDTS, partial) {\n if (partial === void 0) {\n partial = false;\n }\n var elementaryStreams = this.elementaryStreams;\n var info = elementaryStreams[type];\n if (!info) {\n elementaryStreams[type] = {\n startPTS: startPTS,\n endPTS: endPTS,\n startDTS: startDTS,\n endDTS: endDTS,\n partial: partial\n };\n return;\n }\n info.startPTS = Math.min(info.startPTS, startPTS);\n info.endPTS = Math.max(info.endPTS, endPTS);\n info.startDTS = Math.min(info.startDTS, startDTS);\n info.endDTS = Math.max(info.endDTS, endDTS);\n };\n _proto2.clearElementaryStreamInfo = function clearElementaryStreamInfo() {\n var elementaryStreams = this.elementaryStreams;\n elementaryStreams[ElementaryStreamTypes.AUDIO] = null;\n elementaryStreams[ElementaryStreamTypes.VIDEO] = null;\n elementaryStreams[ElementaryStreamTypes.AUDIOVIDEO] = null;\n };\n _createClass(Fragment, [{\n key: \"decryptdata\",\n get: function get() {\n var levelkeys = this.levelkeys;\n if (!levelkeys && !this._decryptdata) {\n return null;\n }\n if (!this._decryptdata && this.levelkeys && !this.levelkeys.NONE) {\n var _key2 = this.levelkeys.identity;\n if (_key2) {\n this._decryptdata = _key2.getDecryptData(this.sn);\n } else {\n var keyFormats = Object.keys(this.levelkeys);\n if (keyFormats.length === 1) {\n return this._decryptdata = this.levelkeys[keyFormats[0]].getDecryptData(this.sn);\n } else {\n // Multiple keys. key-loader to call Fragment.setKeyFormat based on selected key-system.\n }\n }\n }\n return this._decryptdata;\n }\n }, {\n key: \"end\",\n get: function get() {\n return this.start + this.duration;\n }\n }, {\n key: \"endProgramDateTime\",\n get: function get() {\n if (this.programDateTime === null) {\n return null;\n }\n if (!(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(this.programDateTime)) {\n return null;\n }\n var duration = !(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(this.duration) ? 0 : this.duration;\n return this.programDateTime + duration * 1000;\n }\n }, {\n key: \"encrypted\",\n get: function get() {\n var _this$_decryptdata;\n // At the m3u8-parser level we need to add support for manifest signalled keyformats\n // when we want the fragment to start reporting that it is encrypted.\n // Currently, keyFormat will only be set for identity keys\n if ((_this$_decryptdata = this._decryptdata) !== null && _this$_decryptdata !== void 0 && _this$_decryptdata.encrypted) {\n return true;\n } else if (this.levelkeys) {\n var keyFormats = Object.keys(this.levelkeys);\n var len = keyFormats.length;\n if (len > 1 || len === 1 && this.levelkeys[keyFormats[0]].encrypted) {\n return true;\n }\n }\n return false;\n }\n }]);\n return Fragment;\n}(BaseSegment);\nvar Part = /*#__PURE__*/function (_BaseSegment2) {\n _inheritsLoose(Part, _BaseSegment2);\n function Part(partAttrs, frag, baseurl, index, previous) {\n var _this2;\n _this2 = _BaseSegment2.call(this, baseurl) || this;\n _this2.fragOffset = 0;\n _this2.duration = 0;\n _this2.gap = false;\n _this2.independent = false;\n _this2.relurl = void 0;\n _this2.fragment = void 0;\n _this2.index = void 0;\n _this2.stats = new _load_stats__WEBPACK_IMPORTED_MODULE_2__.LoadStats();\n _this2.duration = partAttrs.decimalFloatingPoint('DURATION');\n _this2.gap = partAttrs.bool('GAP');\n _this2.independent = partAttrs.bool('INDEPENDENT');\n _this2.relurl = partAttrs.enumeratedString('URI');\n _this2.fragment = frag;\n _this2.index = index;\n var byteRange = partAttrs.enumeratedString('BYTERANGE');\n if (byteRange) {\n _this2.setByteRange(byteRange, previous);\n }\n if (previous) {\n _this2.fragOffset = previous.fragOffset + previous.duration;\n }\n return _this2;\n }\n _createClass(Part, [{\n key: \"start\",\n get: function get() {\n return this.fragment.start + this.fragOffset;\n }\n }, {\n key: \"end\",\n get: function get() {\n return this.start + this.duration;\n }\n }, {\n key: \"loaded\",\n get: function get() {\n var elementaryStreams = this.elementaryStreams;\n return !!(elementaryStreams.audio || elementaryStreams.video || elementaryStreams.audiovideo);\n }\n }]);\n return Part;\n}(BaseSegment);\n\n/***/ }),\n\n/***/ \"./src/loader/key-loader.ts\":\n/*!**********************************!*\\\n !*** ./src/loader/key-loader.ts ***!\n \\**********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ KeyLoader)\n/* harmony export */ });\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _fragment_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fragment-loader */ \"./src/loader/fragment-loader.ts\");\n\n\nvar KeyLoader = /*#__PURE__*/function () {\n function KeyLoader(config) {\n this.config = void 0;\n this.keyUriToKeyInfo = {};\n this.emeController = null;\n this.config = config;\n }\n var _proto = KeyLoader.prototype;\n _proto.abort = function abort() {\n for (var uri in this.keyUriToKeyInfo) {\n var loader = this.keyUriToKeyInfo[uri].loader;\n if (loader) {\n loader.abort();\n }\n }\n };\n _proto.detach = function detach() {\n for (var uri in this.keyUriToKeyInfo) {\n var keyInfo = this.keyUriToKeyInfo[uri];\n // Remove cached EME keys on detach\n if (keyInfo.mediaKeySessionContext || keyInfo.decryptdata.isCommonEncryption) {\n delete this.keyUriToKeyInfo[uri];\n }\n }\n };\n _proto.destroy = function destroy() {\n this.detach();\n for (var uri in this.keyUriToKeyInfo) {\n var loader = this.keyUriToKeyInfo[uri].loader;\n if (loader) {\n loader.destroy();\n }\n }\n this.keyUriToKeyInfo = {};\n };\n _proto.createKeyLoadError = function createKeyLoadError(frag, details, networkDetails, message) {\n if (details === void 0) {\n details = _errors__WEBPACK_IMPORTED_MODULE_0__.ErrorDetails.KEY_LOAD_ERROR;\n }\n return new _fragment_loader__WEBPACK_IMPORTED_MODULE_1__.LoadError({\n type: _errors__WEBPACK_IMPORTED_MODULE_0__.ErrorTypes.NETWORK_ERROR,\n details: details,\n fatal: false,\n frag: frag,\n networkDetails: networkDetails\n });\n };\n _proto.loadClear = function loadClear(loadingFrag, encryptedFragments) {\n var _this = this;\n if (this.emeController && this.config.emeEnabled) {\n // access key-system with nearest key on start (loaidng frag is unencrypted)\n var sn = loadingFrag.sn,\n cc = loadingFrag.cc;\n var _loop = function _loop(i) {\n var frag = encryptedFragments[i];\n if (cc <= frag.cc && (sn === 'initSegment' || sn < frag.sn)) {\n _this.emeController.selectKeySystemFormat(frag).then(function (keySystemFormat) {\n frag.setKeyFormat(keySystemFormat);\n });\n return \"break\";\n }\n };\n for (var i = 0; i < encryptedFragments.length; i++) {\n var _ret = _loop(i);\n if (_ret === \"break\") break;\n }\n }\n };\n _proto.load = function load(frag) {\n var _this2 = this;\n if (!frag.decryptdata && frag.encrypted && this.emeController) {\n // Multiple keys, but none selected, resolve in eme-controller\n return this.emeController.selectKeySystemFormat(frag).then(function (keySystemFormat) {\n return _this2.loadInternal(frag, keySystemFormat);\n });\n }\n return this.loadInternal(frag);\n };\n _proto.loadInternal = function loadInternal(frag, keySystemFormat) {\n var _keyInfo, _keyInfo2;\n if (keySystemFormat) {\n frag.setKeyFormat(keySystemFormat);\n }\n var decryptdata = frag.decryptdata;\n if (!decryptdata) {\n var errorMessage = keySystemFormat ? \"Expected frag.decryptdata to be defined after setting format \" + keySystemFormat : 'Missing decryption data on fragment in onKeyLoading';\n return Promise.reject(this.createKeyLoadError(frag, _errors__WEBPACK_IMPORTED_MODULE_0__.ErrorDetails.KEY_LOAD_ERROR, null, errorMessage));\n }\n var uri = decryptdata.uri;\n if (!uri) {\n return Promise.reject(this.createKeyLoadError(frag, _errors__WEBPACK_IMPORTED_MODULE_0__.ErrorDetails.KEY_LOAD_ERROR, null, \"Invalid key URI: \\\"\" + uri + \"\\\"\"));\n }\n var keyInfo = this.keyUriToKeyInfo[uri];\n if ((_keyInfo = keyInfo) !== null && _keyInfo !== void 0 && _keyInfo.decryptdata.key) {\n decryptdata.key = keyInfo.decryptdata.key;\n return Promise.resolve({\n frag: frag,\n keyInfo: keyInfo\n });\n }\n // Return key load promise as long as it does not have a mediakey session with an unusable key status\n if ((_keyInfo2 = keyInfo) !== null && _keyInfo2 !== void 0 && _keyInfo2.keyLoadPromise) {\n var _keyInfo$mediaKeySess;\n switch ((_keyInfo$mediaKeySess = keyInfo.mediaKeySessionContext) === null || _keyInfo$mediaKeySess === void 0 ? void 0 : _keyInfo$mediaKeySess.keyStatus) {\n case undefined:\n case 'status-pending':\n case 'usable':\n case 'usable-in-future':\n return keyInfo.keyLoadPromise.then(function (keyLoadedData) {\n // Return the correct fragment with updated decryptdata key and loaded keyInfo\n decryptdata.key = keyLoadedData.keyInfo.decryptdata.key;\n return {\n frag: frag,\n keyInfo: keyInfo\n };\n });\n }\n // If we have a key session and status and it is not pending or usable, continue\n // This will go back to the eme-controller for expired keys to get a new keyLoadPromise\n }\n\n // Load the key or return the loading promise\n keyInfo = this.keyUriToKeyInfo[uri] = {\n decryptdata: decryptdata,\n keyLoadPromise: null,\n loader: null,\n mediaKeySessionContext: null\n };\n switch (decryptdata.method) {\n case 'ISO-23001-7':\n case 'SAMPLE-AES':\n case 'SAMPLE-AES-CENC':\n case 'SAMPLE-AES-CTR':\n if (decryptdata.keyFormat === 'identity') {\n // loadKeyHTTP handles http(s) and data URLs\n return this.loadKeyHTTP(keyInfo, frag);\n }\n return this.loadKeyEME(keyInfo, frag);\n case 'AES-128':\n return this.loadKeyHTTP(keyInfo, frag);\n default:\n return Promise.reject(this.createKeyLoadError(frag, _errors__WEBPACK_IMPORTED_MODULE_0__.ErrorDetails.KEY_LOAD_ERROR, null, \"Key supplied with unsupported METHOD: \\\"\" + decryptdata.method + \"\\\"\"));\n }\n };\n _proto.loadKeyEME = function loadKeyEME(keyInfo, frag) {\n var keyLoadedData = {\n frag: frag,\n keyInfo: keyInfo\n };\n if (this.emeController && this.config.emeEnabled) {\n var keySessionContextPromise = this.emeController.loadKey(keyLoadedData);\n if (keySessionContextPromise) {\n return (keyInfo.keyLoadPromise = keySessionContextPromise.then(function (keySessionContext) {\n keyInfo.mediaKeySessionContext = keySessionContext;\n return keyLoadedData;\n })).catch(function (error) {\n // Remove promise for license renewal or retry\n keyInfo.keyLoadPromise = null;\n throw error;\n });\n }\n }\n return Promise.resolve(keyLoadedData);\n };\n _proto.loadKeyHTTP = function loadKeyHTTP(keyInfo, frag) {\n var _this3 = this;\n var config = this.config;\n var Loader = config.loader;\n var keyLoader = new Loader(config);\n frag.keyLoader = keyInfo.loader = keyLoader;\n return keyInfo.keyLoadPromise = new Promise(function (resolve, reject) {\n var loaderContext = {\n keyInfo: keyInfo,\n frag: frag,\n responseType: 'arraybuffer',\n url: keyInfo.decryptdata.uri\n };\n\n // maxRetry is 0 so that instead of retrying the same key on the same variant multiple times,\n // key-loader will trigger an error and rely on stream-controller to handle retry logic.\n // this will also align retry logic with fragment-loader\n var loaderConfig = {\n timeout: config.fragLoadingTimeOut,\n maxRetry: 0,\n retryDelay: config.fragLoadingRetryDelay,\n maxRetryDelay: config.fragLoadingMaxRetryTimeout,\n highWaterMark: 0\n };\n var loaderCallbacks = {\n onSuccess: function onSuccess(response, stats, context, networkDetails) {\n var frag = context.frag,\n keyInfo = context.keyInfo,\n uri = context.url;\n if (!frag.decryptdata || keyInfo !== _this3.keyUriToKeyInfo[uri]) {\n return reject(_this3.createKeyLoadError(frag, _errors__WEBPACK_IMPORTED_MODULE_0__.ErrorDetails.KEY_LOAD_ERROR, networkDetails, 'after key load, decryptdata unset or changed'));\n }\n keyInfo.decryptdata.key = frag.decryptdata.key = new Uint8Array(response.data);\n\n // detach fragment key loader on load success\n frag.keyLoader = null;\n keyInfo.loader = null;\n resolve({\n frag: frag,\n keyInfo: keyInfo\n });\n },\n onError: function onError(error, context, networkDetails) {\n _this3.resetLoader(context);\n reject(_this3.createKeyLoadError(frag, _errors__WEBPACK_IMPORTED_MODULE_0__.ErrorDetails.KEY_LOAD_ERROR, networkDetails));\n },\n onTimeout: function onTimeout(stats, context, networkDetails) {\n _this3.resetLoader(context);\n reject(_this3.createKeyLoadError(frag, _errors__WEBPACK_IMPORTED_MODULE_0__.ErrorDetails.KEY_LOAD_TIMEOUT, networkDetails));\n },\n onAbort: function onAbort(stats, context, networkDetails) {\n _this3.resetLoader(context);\n reject(_this3.createKeyLoadError(frag, _errors__WEBPACK_IMPORTED_MODULE_0__.ErrorDetails.INTERNAL_ABORTED, networkDetails));\n }\n };\n keyLoader.load(loaderContext, loaderConfig, loaderCallbacks);\n });\n };\n _proto.resetLoader = function resetLoader(context) {\n var frag = context.frag,\n keyInfo = context.keyInfo,\n uri = context.url;\n var loader = keyInfo.loader;\n if (frag.keyLoader === loader) {\n frag.keyLoader = null;\n keyInfo.loader = null;\n }\n delete this.keyUriToKeyInfo[uri];\n if (loader) {\n loader.destroy();\n }\n };\n return KeyLoader;\n}();\n\n\n/***/ }),\n\n/***/ \"./src/loader/level-details.ts\":\n/*!*************************************!*\\\n !*** ./src/loader/level-details.ts ***!\n \\*************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"LevelDetails\": () => (/* binding */ LevelDetails)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar DEFAULT_TARGET_DURATION = 10;\nvar LevelDetails = /*#__PURE__*/function () {\n // Manifest reload synchronization\n\n function LevelDetails(baseUrl) {\n this.PTSKnown = false;\n this.alignedSliding = false;\n this.averagetargetduration = void 0;\n this.endCC = 0;\n this.endSN = 0;\n this.fragments = void 0;\n this.fragmentHint = void 0;\n this.partList = null;\n this.dateRanges = void 0;\n this.live = true;\n this.ageHeader = 0;\n this.advancedDateTime = void 0;\n this.updated = true;\n this.advanced = true;\n this.availabilityDelay = void 0;\n this.misses = 0;\n this.startCC = 0;\n this.startSN = 0;\n this.startTimeOffset = null;\n this.targetduration = 0;\n this.totalduration = 0;\n this.type = null;\n this.url = void 0;\n this.m3u8 = '';\n this.version = null;\n this.canBlockReload = false;\n this.canSkipUntil = 0;\n this.canSkipDateRanges = false;\n this.skippedSegments = 0;\n this.recentlyRemovedDateranges = void 0;\n this.partHoldBack = 0;\n this.holdBack = 0;\n this.partTarget = 0;\n this.preloadHint = void 0;\n this.renditionReports = void 0;\n this.tuneInGoal = 0;\n this.deltaUpdateFailed = void 0;\n this.driftStartTime = 0;\n this.driftEndTime = 0;\n this.driftStart = 0;\n this.driftEnd = 0;\n this.encryptedFragments = void 0;\n this.fragments = [];\n this.encryptedFragments = [];\n this.dateRanges = {};\n this.url = baseUrl;\n }\n var _proto = LevelDetails.prototype;\n _proto.reloaded = function reloaded(previous) {\n if (!previous) {\n this.advanced = true;\n this.updated = true;\n return;\n }\n var partSnDiff = this.lastPartSn - previous.lastPartSn;\n var partIndexDiff = this.lastPartIndex - previous.lastPartIndex;\n this.updated = this.endSN !== previous.endSN || !!partIndexDiff || !!partSnDiff;\n this.advanced = this.endSN > previous.endSN || partSnDiff > 0 || partSnDiff === 0 && partIndexDiff > 0;\n if (this.updated || this.advanced) {\n this.misses = Math.floor(previous.misses * 0.6);\n } else {\n this.misses = previous.misses + 1;\n }\n this.availabilityDelay = previous.availabilityDelay;\n };\n _createClass(LevelDetails, [{\n key: \"hasProgramDateTime\",\n get: function get() {\n if (this.fragments.length) {\n return (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(this.fragments[this.fragments.length - 1].programDateTime);\n }\n return false;\n }\n }, {\n key: \"levelTargetDuration\",\n get: function get() {\n return this.averagetargetduration || this.targetduration || DEFAULT_TARGET_DURATION;\n }\n }, {\n key: \"drift\",\n get: function get() {\n var runTime = this.driftEndTime - this.driftStartTime;\n if (runTime > 0) {\n var runDuration = this.driftEnd - this.driftStart;\n return runDuration * 1000 / runTime;\n }\n return 1;\n }\n }, {\n key: \"edge\",\n get: function get() {\n return this.partEnd || this.fragmentEnd;\n }\n }, {\n key: \"partEnd\",\n get: function get() {\n var _this$partList;\n if ((_this$partList = this.partList) !== null && _this$partList !== void 0 && _this$partList.length) {\n return this.partList[this.partList.length - 1].end;\n }\n return this.fragmentEnd;\n }\n }, {\n key: \"fragmentEnd\",\n get: function get() {\n var _this$fragments;\n if ((_this$fragments = this.fragments) !== null && _this$fragments !== void 0 && _this$fragments.length) {\n return this.fragments[this.fragments.length - 1].end;\n }\n return 0;\n }\n }, {\n key: \"age\",\n get: function get() {\n if (this.advancedDateTime) {\n return Math.max(Date.now() - this.advancedDateTime, 0) / 1000;\n }\n return 0;\n }\n }, {\n key: \"lastPartIndex\",\n get: function get() {\n var _this$partList2;\n if ((_this$partList2 = this.partList) !== null && _this$partList2 !== void 0 && _this$partList2.length) {\n return this.partList[this.partList.length - 1].index;\n }\n return -1;\n }\n }, {\n key: \"lastPartSn\",\n get: function get() {\n var _this$partList3;\n if ((_this$partList3 = this.partList) !== null && _this$partList3 !== void 0 && _this$partList3.length) {\n return this.partList[this.partList.length - 1].fragment.sn;\n }\n return this.endSN;\n }\n }]);\n return LevelDetails;\n}();\n\n/***/ }),\n\n/***/ \"./src/loader/level-key.ts\":\n/*!*********************************!*\\\n !*** ./src/loader/level-key.ts ***!\n \\*********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"LevelKey\": () => (/* binding */ LevelKey)\n/* harmony export */ });\n/* harmony import */ var _utils_keysystem_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/keysystem-util */ \"./src/utils/keysystem-util.ts\");\n/* harmony import */ var _utils_mediakeys_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/mediakeys-helper */ \"./src/utils/mediakeys-helper.ts\");\n/* harmony import */ var _utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/mp4-tools */ \"./src/utils/mp4-tools.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _utils_numeric_encoding_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/numeric-encoding-utils */ \"./src/utils/numeric-encoding-utils.ts\");\n\n\n\n\n\nvar keyUriToKeyIdMap = {};\nvar LevelKey = /*#__PURE__*/function () {\n LevelKey.clearKeyUriToKeyIdMap = function clearKeyUriToKeyIdMap() {\n keyUriToKeyIdMap = {};\n };\n function LevelKey(method, uri, format, formatversions, iv) {\n if (formatversions === void 0) {\n formatversions = [1];\n }\n if (iv === void 0) {\n iv = null;\n }\n this.uri = void 0;\n this.method = void 0;\n this.keyFormat = void 0;\n this.keyFormatVersions = void 0;\n this.encrypted = void 0;\n this.isCommonEncryption = void 0;\n this.iv = null;\n this.key = null;\n this.keyId = null;\n this.pssh = null;\n this.method = method;\n this.uri = uri;\n this.keyFormat = format;\n this.keyFormatVersions = formatversions;\n this.iv = iv;\n this.encrypted = method ? method !== 'NONE' : false;\n this.isCommonEncryption = this.encrypted && method !== 'AES-128';\n }\n var _proto = LevelKey.prototype;\n _proto.isSupported = function isSupported() {\n // If it's Segment encryption or No encryption, just select that key system\n if (this.method) {\n if (this.method === 'AES-128' || this.method === 'NONE') {\n return true;\n }\n switch (this.keyFormat) {\n case 'identity':\n // Maintain support for clear SAMPLE-AES with MPEG-3 TS\n return this.method === 'SAMPLE-AES';\n case _utils_mediakeys_helper__WEBPACK_IMPORTED_MODULE_1__.KeySystemFormats.FAIRPLAY:\n case _utils_mediakeys_helper__WEBPACK_IMPORTED_MODULE_1__.KeySystemFormats.WIDEVINE:\n case _utils_mediakeys_helper__WEBPACK_IMPORTED_MODULE_1__.KeySystemFormats.PLAYREADY:\n case _utils_mediakeys_helper__WEBPACK_IMPORTED_MODULE_1__.KeySystemFormats.CLEARKEY:\n return ['ISO-23001-7', 'SAMPLE-AES', 'SAMPLE-AES-CENC', 'SAMPLE-AES-CTR'].indexOf(this.method) !== -1;\n }\n }\n return false;\n };\n _proto.getDecryptData = function getDecryptData(sn) {\n if (!this.encrypted || !this.uri) {\n return null;\n }\n if (this.method === 'AES-128' && this.uri && !this.iv) {\n if (typeof sn !== 'number') {\n // We are fetching decryption data for a initialization segment\n // If the segment was encrypted with AES-128\n // It must have an IV defined. We cannot substitute the Segment Number in.\n if (this.method === 'AES-128' && !this.iv) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.warn(\"missing IV for initialization segment with method=\\\"\" + this.method + \"\\\" - compliance issue\");\n }\n // Explicitly set sn to resulting value from implicit conversions 'initSegment' values for IV generation.\n sn = 0;\n }\n var iv = createInitializationVector(sn);\n var decryptdata = new LevelKey(this.method, this.uri, 'identity', this.keyFormatVersions, iv);\n return decryptdata;\n }\n\n // Initialize keyId if possible\n var keyBytes = (0,_utils_keysystem_util__WEBPACK_IMPORTED_MODULE_0__.convertDataUriToArrayBytes)(this.uri);\n if (keyBytes) {\n switch (this.keyFormat) {\n case _utils_mediakeys_helper__WEBPACK_IMPORTED_MODULE_1__.KeySystemFormats.WIDEVINE:\n this.pssh = keyBytes;\n // In case of widevine keyID is embedded in PSSH box. Read Key ID.\n if (keyBytes.length >= 22) {\n this.keyId = keyBytes.subarray(keyBytes.length - 22, keyBytes.length - 6);\n }\n break;\n case _utils_mediakeys_helper__WEBPACK_IMPORTED_MODULE_1__.KeySystemFormats.PLAYREADY:\n {\n var PlayReadyKeySystemUUID = new Uint8Array([0x9a, 0x04, 0xf0, 0x79, 0x98, 0x40, 0x42, 0x86, 0xab, 0x92, 0xe6, 0x5b, 0xe0, 0x88, 0x5f, 0x95]);\n this.pssh = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.mp4pssh)(PlayReadyKeySystemUUID, null, keyBytes);\n var keyBytesUtf16 = new Uint16Array(keyBytes.buffer, keyBytes.byteOffset, keyBytes.byteLength / 2);\n var keyByteStr = String.fromCharCode.apply(null, Array.from(keyBytesUtf16));\n\n // Parse Playready WRMHeader XML\n var xmlKeyBytes = keyByteStr.substring(keyByteStr.indexOf('<'), keyByteStr.length);\n var parser = new DOMParser();\n var xmlDoc = parser.parseFromString(xmlKeyBytes, 'text/xml');\n var keyData = xmlDoc.getElementsByTagName('KID')[0];\n if (keyData) {\n var keyId = keyData.childNodes[0] ? keyData.childNodes[0].nodeValue : keyData.getAttribute('VALUE');\n if (keyId) {\n var keyIdArray = (0,_utils_numeric_encoding_utils__WEBPACK_IMPORTED_MODULE_4__.base64Decode)(keyId).subarray(0, 16);\n // KID value in PRO is a base64-encoded little endian GUID interpretation of UUID\n // KID value in ‘tenc’ is a big endian UUID GUID interpretation of UUID\n (0,_utils_keysystem_util__WEBPACK_IMPORTED_MODULE_0__.changeEndianness)(keyIdArray);\n this.keyId = keyIdArray;\n }\n }\n break;\n }\n default:\n {\n var keydata = keyBytes.subarray(0, 16);\n if (keydata.length !== 16) {\n var padded = new Uint8Array(16);\n padded.set(keydata, 16 - keydata.length);\n keydata = padded;\n }\n this.keyId = keydata;\n break;\n }\n }\n }\n\n // Default behavior: assign a new keyId for each uri\n if (!this.keyId || this.keyId.byteLength !== 16) {\n var _keyId = keyUriToKeyIdMap[this.uri];\n if (!_keyId) {\n var val = Object.keys(keyUriToKeyIdMap).length % Number.MAX_SAFE_INTEGER;\n _keyId = new Uint8Array(16);\n var dv = new DataView(_keyId.buffer, 12, 4); // Just set the last 4 bytes\n dv.setUint32(0, val);\n keyUriToKeyIdMap[this.uri] = _keyId;\n }\n this.keyId = _keyId;\n }\n return this;\n };\n return LevelKey;\n}();\nfunction createInitializationVector(segmentNumber) {\n var uint8View = new Uint8Array(16);\n for (var i = 12; i < 16; i++) {\n uint8View[i] = segmentNumber >> 8 * (15 - i) & 0xff;\n }\n return uint8View;\n}\n\n/***/ }),\n\n/***/ \"./src/loader/load-stats.ts\":\n/*!**********************************!*\\\n !*** ./src/loader/load-stats.ts ***!\n \\**********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"LoadStats\": () => (/* binding */ LoadStats)\n/* harmony export */ });\nvar LoadStats = function LoadStats() {\n this.aborted = false;\n this.loaded = 0;\n this.retry = 0;\n this.total = 0;\n this.chunkCount = 0;\n this.bwEstimate = 0;\n this.loading = {\n start: 0,\n first: 0,\n end: 0\n };\n this.parsing = {\n start: 0,\n end: 0\n };\n this.buffering = {\n start: 0,\n first: 0,\n end: 0\n };\n};\n\n/***/ }),\n\n/***/ \"./src/loader/m3u8-parser.ts\":\n/*!***********************************!*\\\n !*** ./src/loader/m3u8-parser.ts ***!\n \\***********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ M3U8Parser)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var url_toolkit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! url-toolkit */ \"./node_modules/url-toolkit/src/url-toolkit.js\");\n/* harmony import */ var url_toolkit__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(url_toolkit__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _date_range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./date-range */ \"./src/loader/date-range.ts\");\n/* harmony import */ var _fragment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fragment */ \"./src/loader/fragment.ts\");\n/* harmony import */ var _level_details__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./level-details */ \"./src/loader/level-details.ts\");\n/* harmony import */ var _level_key__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./level-key */ \"./src/loader/level-key.ts\");\n/* harmony import */ var _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/attr-list */ \"./src/utils/attr-list.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _utils_codecs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/codecs */ \"./src/utils/codecs.ts\");\n\n\n\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\n\n\n\n\n\n\n\n// https://regex101.com is your friend\nvar MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\\r\\n]*)(?:[\\r\\n](?:#[^\\r\\n]*)?)*([^\\r\\n]+)|#EXT-X-SESSION-DATA:([^\\r\\n]*)[\\r\\n]+|#EXT-X-SESSION-KEY:([^\\n\\r]*)[\\r\\n]+/g;\nvar MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;\nvar LEVEL_PLAYLIST_REGEX_FAST = new RegExp([/#EXTINF:\\s*(\\d*(?:\\.\\d+)?)(?:,(.*)\\s+)?/.source,\n// duration (#EXTINF:<duration>,<title>), group 1 => duration, group 2 => title\n/(?!#) *(\\S[\\S ]*)/.source,\n// segment URI, group 3 => the URI (note newline is not eaten)\n/#EXT-X-BYTERANGE:*(.+)/.source,\n// next segment's byterange, group 4 => range spec (x@y)\n/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,\n// next segment's program date/time group 5 => the datetime spec\n/#.*/.source // All other non-segment oriented tags will match with all groups empty\n].join('|'), 'g');\nvar LEVEL_PLAYLIST_REGEX_SLOW = new RegExp([/#(EXTM3U)/.source, /#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source, /#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\\d+)/.source, /#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source, /(#)([^:]*):(.*)/.source, /(#)(.*)(?:.*)\\r?\\n?/.source].join('|'));\nvar M3U8Parser = /*#__PURE__*/function () {\n function M3U8Parser() {}\n M3U8Parser.findGroup = function findGroup(groups, mediaGroupId) {\n for (var i = 0; i < groups.length; i++) {\n var group = groups[i];\n if (group.id === mediaGroupId) {\n return group;\n }\n }\n };\n M3U8Parser.convertAVC1ToAVCOTI = function convertAVC1ToAVCOTI(codec) {\n // Convert avc1 codec string from RFC-4281 to RFC-6381 for MediaSource.isTypeSupported\n var avcdata = codec.split('.');\n if (avcdata.length > 2) {\n var result = avcdata.shift() + '.';\n result += parseInt(avcdata.shift()).toString(16);\n result += ('000' + parseInt(avcdata.shift()).toString(16)).slice(-4);\n return result;\n }\n return codec;\n };\n M3U8Parser.resolve = function resolve(url, baseUrl) {\n return (0,url_toolkit__WEBPACK_IMPORTED_MODULE_1__.buildAbsoluteURL)(baseUrl, url, {\n alwaysNormalize: true\n });\n };\n M3U8Parser.parseMasterPlaylist = function parseMasterPlaylist(string, baseurl) {\n var levels = [];\n var levelsWithKnownCodecs = [];\n var sessionData = {};\n var sessionKeys = [];\n var hasSessionData = false;\n MASTER_PLAYLIST_REGEX.lastIndex = 0;\n var result;\n while ((result = MASTER_PLAYLIST_REGEX.exec(string)) != null) {\n if (result[1]) {\n var _level$unknownCodecs;\n // '#EXT-X-STREAM-INF' is found, parse level tag in group 1\n var attrs = new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(result[1]);\n var level = {\n attrs: attrs,\n bitrate: attrs.decimalInteger('AVERAGE-BANDWIDTH') || attrs.decimalInteger('BANDWIDTH'),\n name: attrs.NAME,\n url: M3U8Parser.resolve(result[2], baseurl)\n };\n var resolution = attrs.decimalResolution('RESOLUTION');\n if (resolution) {\n level.width = resolution.width;\n level.height = resolution.height;\n }\n setCodecs((attrs.CODECS || '').split(/[ ,]+/).filter(function (c) {\n return c;\n }), level);\n if (level.videoCodec && level.videoCodec.indexOf('avc1') !== -1) {\n level.videoCodec = M3U8Parser.convertAVC1ToAVCOTI(level.videoCodec);\n }\n if (!((_level$unknownCodecs = level.unknownCodecs) !== null && _level$unknownCodecs !== void 0 && _level$unknownCodecs.length)) {\n levelsWithKnownCodecs.push(level);\n }\n levels.push(level);\n } else if (result[3]) {\n // '#EXT-X-SESSION-DATA' is found, parse session data in group 3\n var sessionAttrs = new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(result[3]);\n if (sessionAttrs['DATA-ID']) {\n hasSessionData = true;\n sessionData[sessionAttrs['DATA-ID']] = sessionAttrs;\n }\n } else if (result[4]) {\n // '#EXT-X-SESSION-KEY' is found\n var keyTag = result[4];\n var sessionKey = parseKey(keyTag, baseurl);\n if (sessionKey.encrypted && sessionKey.isSupported()) {\n sessionKeys.push(sessionKey);\n } else {\n _utils_logger__WEBPACK_IMPORTED_MODULE_7__.logger.warn(\"[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: \\\"\" + keyTag + \"\\\"\");\n }\n }\n }\n // Filter out levels with unknown codecs if it does not remove all levels\n var stripUnknownCodecLevels = levelsWithKnownCodecs.length > 0 && levelsWithKnownCodecs.length < levels.length;\n return {\n levels: stripUnknownCodecLevels ? levelsWithKnownCodecs : levels,\n sessionData: hasSessionData ? sessionData : null,\n sessionKeys: sessionKeys.length ? sessionKeys : null\n };\n };\n M3U8Parser.parseMasterPlaylistMedia = function parseMasterPlaylistMedia(string, baseurl, type, groups) {\n if (groups === void 0) {\n groups = [];\n }\n var result;\n var medias = [];\n var id = 0;\n MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_MEDIA_REGEX.exec(string)) !== null) {\n var attrs = new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(result[1]);\n if (attrs.TYPE === type) {\n var media = {\n attrs: attrs,\n bitrate: 0,\n id: id++,\n groupId: attrs['GROUP-ID'],\n instreamId: attrs['INSTREAM-ID'],\n name: attrs.NAME || attrs.LANGUAGE || '',\n type: type,\n default: attrs.bool('DEFAULT'),\n autoselect: attrs.bool('AUTOSELECT'),\n forced: attrs.bool('FORCED'),\n lang: attrs.LANGUAGE,\n url: attrs.URI ? M3U8Parser.resolve(attrs.URI, baseurl) : ''\n };\n if (groups.length) {\n // If there are audio or text groups signalled in the manifest, let's look for a matching codec string for this track\n // If we don't find the track signalled, lets use the first audio groups codec we have\n // Acting as a best guess\n var groupCodec = M3U8Parser.findGroup(groups, media.groupId) || groups[0];\n assignCodec(media, groupCodec, 'audioCodec');\n assignCodec(media, groupCodec, 'textCodec');\n }\n medias.push(media);\n }\n }\n return medias;\n };\n M3U8Parser.parseLevelPlaylist = function parseLevelPlaylist(string, baseurl, id, type, levelUrlId) {\n var level = new _level_details__WEBPACK_IMPORTED_MODULE_4__.LevelDetails(baseurl);\n var fragments = level.fragments;\n // The most recent init segment seen (applies to all subsequent segments)\n var currentInitSegment = null;\n var currentSN = 0;\n var currentPart = 0;\n var totalduration = 0;\n var discontinuityCounter = 0;\n var prevFrag = null;\n var frag = new _fragment__WEBPACK_IMPORTED_MODULE_3__.Fragment(type, baseurl);\n var result;\n var i;\n var levelkeys;\n var firstPdtIndex = -1;\n var createNextFrag = false;\n LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;\n level.m3u8 = string;\n while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {\n if (createNextFrag) {\n createNextFrag = false;\n frag = new _fragment__WEBPACK_IMPORTED_MODULE_3__.Fragment(type, baseurl);\n // setup the next fragment for part loading\n frag.start = totalduration;\n frag.sn = currentSN;\n frag.cc = discontinuityCounter;\n frag.level = id;\n if (currentInitSegment) {\n frag.initSegment = currentInitSegment;\n frag.rawProgramDateTime = currentInitSegment.rawProgramDateTime;\n currentInitSegment.rawProgramDateTime = null;\n }\n }\n var duration = result[1];\n if (duration) {\n // INF\n frag.duration = parseFloat(duration);\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n var title = (' ' + result[2]).slice(1);\n frag.title = title || null;\n frag.tagList.push(title ? ['INF', duration, title] : ['INF', duration]);\n } else if (result[3]) {\n // url\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(frag.duration)) {\n frag.start = totalduration;\n if (levelkeys) {\n setFragLevelKeys(frag, levelkeys, level);\n }\n frag.sn = currentSN;\n frag.level = id;\n frag.cc = discontinuityCounter;\n frag.urlId = levelUrlId;\n fragments.push(frag);\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.relurl = (' ' + result[3]).slice(1);\n assignProgramDateTime(frag, prevFrag);\n prevFrag = frag;\n totalduration += frag.duration;\n currentSN++;\n currentPart = 0;\n createNextFrag = true;\n }\n } else if (result[4]) {\n // X-BYTERANGE\n var data = (' ' + result[4]).slice(1);\n if (prevFrag) {\n frag.setByteRange(data, prevFrag);\n } else {\n frag.setByteRange(data);\n }\n } else if (result[5]) {\n // PROGRAM-DATE-TIME\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.rawProgramDateTime = (' ' + result[5]).slice(1);\n frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);\n if (firstPdtIndex === -1) {\n firstPdtIndex = fragments.length;\n }\n } else {\n result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);\n if (!result) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_7__.logger.warn('No matches on slow regex match for level playlist!');\n continue;\n }\n for (i = 1; i < result.length; i++) {\n if (typeof result[i] !== 'undefined') {\n break;\n }\n }\n\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n var tag = (' ' + result[i]).slice(1);\n var value1 = (' ' + result[i + 1]).slice(1);\n var value2 = result[i + 2] ? (' ' + result[i + 2]).slice(1) : '';\n switch (tag) {\n case 'PLAYLIST-TYPE':\n level.type = value1.toUpperCase();\n break;\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(value1);\n break;\n case 'SKIP':\n {\n var skipAttrs = new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(value1);\n var skippedSegments = skipAttrs.decimalInteger('SKIPPED-SEGMENTS');\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(skippedSegments)) {\n level.skippedSegments = skippedSegments;\n // This will result in fragments[] containing undefined values, which we will fill in with `mergeDetails`\n for (var _i = skippedSegments; _i--;) {\n fragments.unshift(null);\n }\n currentSN += skippedSegments;\n }\n var recentlyRemovedDateranges = skipAttrs.enumeratedString('RECENTLY-REMOVED-DATERANGES');\n if (recentlyRemovedDateranges) {\n level.recentlyRemovedDateranges = recentlyRemovedDateranges.split('\\t');\n }\n break;\n }\n case 'TARGETDURATION':\n level.targetduration = parseFloat(value1);\n break;\n case 'VERSION':\n level.version = parseInt(value1);\n break;\n case 'EXTM3U':\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case '#':\n if (value1 || value2) {\n frag.tagList.push(value2 ? [value1, value2] : [value1]);\n }\n break;\n case 'DISCONTINUITY':\n discontinuityCounter++;\n frag.tagList.push(['DIS']);\n break;\n case 'GAP':\n frag.tagList.push([tag]);\n break;\n case 'BITRATE':\n frag.tagList.push([tag, value1]);\n break;\n case 'DATERANGE':\n {\n var dateRangeAttr = new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(value1);\n var dateRange = new _date_range__WEBPACK_IMPORTED_MODULE_2__.DateRange(dateRangeAttr, level.dateRanges[dateRangeAttr.ID]);\n if (dateRange.isValid || level.skippedSegments) {\n level.dateRanges[dateRange.id] = dateRange;\n } else {\n _utils_logger__WEBPACK_IMPORTED_MODULE_7__.logger.warn(\"Ignoring invalid DATERANGE tag: \\\"\" + value1 + \"\\\"\");\n }\n // Add to fragment tag list for backwards compatibility (< v1.2.0)\n frag.tagList.push(['EXT-X-DATERANGE', value1]);\n break;\n }\n case 'DISCONTINUITY-SEQUENCE':\n discontinuityCounter = parseInt(value1);\n break;\n case 'KEY':\n {\n var levelKey = parseKey(value1, baseurl);\n if (levelKey.isSupported()) {\n if (levelKey.method === 'NONE') {\n levelkeys = undefined;\n break;\n }\n if (!levelkeys) {\n levelkeys = {};\n }\n if (levelkeys[levelKey.keyFormat]) {\n levelkeys = _extends({}, levelkeys);\n }\n levelkeys[levelKey.keyFormat] = levelKey;\n } else {\n _utils_logger__WEBPACK_IMPORTED_MODULE_7__.logger.warn(\"[Keys] Ignoring invalid EXT-X-KEY tag: \\\"\" + value1 + \"\\\"\");\n }\n break;\n }\n case 'START':\n {\n var startAttrs = new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(value1);\n var startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');\n // TIME-OFFSET can be 0\n if ((0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(startTimeOffset)) {\n level.startTimeOffset = startTimeOffset;\n }\n break;\n }\n case 'MAP':\n {\n var mapAttrs = new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(value1);\n if (frag.duration) {\n // Initial segment tag is after segment duration tag.\n // #EXTINF: 6.0\n // #EXT-X-MAP:URI=\"init.mp4\n var init = new _fragment__WEBPACK_IMPORTED_MODULE_3__.Fragment(type, baseurl);\n setInitSegment(init, mapAttrs, id, levelkeys);\n currentInitSegment = init;\n frag.initSegment = currentInitSegment;\n if (currentInitSegment.rawProgramDateTime && !frag.rawProgramDateTime) {\n frag.rawProgramDateTime = currentInitSegment.rawProgramDateTime;\n }\n } else {\n // Initial segment tag is before segment duration tag\n setInitSegment(frag, mapAttrs, id, levelkeys);\n currentInitSegment = frag;\n createNextFrag = true;\n }\n break;\n }\n case 'SERVER-CONTROL':\n {\n var serverControlAttrs = new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(value1);\n level.canBlockReload = serverControlAttrs.bool('CAN-BLOCK-RELOAD');\n level.canSkipUntil = serverControlAttrs.optionalFloat('CAN-SKIP-UNTIL', 0);\n level.canSkipDateRanges = level.canSkipUntil > 0 && serverControlAttrs.bool('CAN-SKIP-DATERANGES');\n level.partHoldBack = serverControlAttrs.optionalFloat('PART-HOLD-BACK', 0);\n level.holdBack = serverControlAttrs.optionalFloat('HOLD-BACK', 0);\n break;\n }\n case 'PART-INF':\n {\n var partInfAttrs = new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(value1);\n level.partTarget = partInfAttrs.decimalFloatingPoint('PART-TARGET');\n break;\n }\n case 'PART':\n {\n var partList = level.partList;\n if (!partList) {\n partList = level.partList = [];\n }\n var previousFragmentPart = currentPart > 0 ? partList[partList.length - 1] : undefined;\n var index = currentPart++;\n var part = new _fragment__WEBPACK_IMPORTED_MODULE_3__.Part(new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(value1), frag, baseurl, index, previousFragmentPart);\n partList.push(part);\n frag.duration += part.duration;\n break;\n }\n case 'PRELOAD-HINT':\n {\n var preloadHintAttrs = new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(value1);\n level.preloadHint = preloadHintAttrs;\n break;\n }\n case 'RENDITION-REPORT':\n {\n var renditionReportAttrs = new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(value1);\n level.renditionReports = level.renditionReports || [];\n level.renditionReports.push(renditionReportAttrs);\n break;\n }\n default:\n _utils_logger__WEBPACK_IMPORTED_MODULE_7__.logger.warn(\"line parsed but not handled: \" + result);\n break;\n }\n }\n }\n if (prevFrag && !prevFrag.relurl) {\n fragments.pop();\n totalduration -= prevFrag.duration;\n if (level.partList) {\n level.fragmentHint = prevFrag;\n }\n } else if (level.partList) {\n assignProgramDateTime(frag, prevFrag);\n frag.cc = discontinuityCounter;\n level.fragmentHint = frag;\n if (levelkeys) {\n setFragLevelKeys(frag, levelkeys, level);\n }\n }\n var fragmentLength = fragments.length;\n var firstFragment = fragments[0];\n var lastFragment = fragments[fragmentLength - 1];\n totalduration += level.skippedSegments * level.targetduration;\n if (totalduration > 0 && fragmentLength && lastFragment) {\n level.averagetargetduration = totalduration / fragmentLength;\n var lastSn = lastFragment.sn;\n level.endSN = lastSn !== 'initSegment' ? lastSn : 0;\n if (!level.live) {\n lastFragment.endList = true;\n }\n if (firstFragment) {\n level.startCC = firstFragment.cc;\n }\n } else {\n level.endSN = 0;\n level.startCC = 0;\n }\n if (level.fragmentHint) {\n totalduration += level.fragmentHint.duration;\n }\n level.totalduration = totalduration;\n level.endCC = discontinuityCounter;\n\n /**\n * Backfill any missing PDT values\n * \"If the first EXT-X-PROGRAM-DATE-TIME tag in a Playlist appears after\n * one or more Media Segment URIs, the client SHOULD extrapolate\n * backward from that tag (using EXTINF durations and/or media\n * timestamps) to associate dates with those segments.\"\n * We have already extrapolated forward, but all fragments up to the first instance of PDT do not have their PDTs\n * computed.\n */\n if (firstPdtIndex > 0) {\n backfillProgramDateTimes(fragments, firstPdtIndex);\n }\n return level;\n };\n return M3U8Parser;\n}();\n\nfunction parseKey(keyTag, baseurl) {\n var _keyAttrs$enumeratedS, _keyAttrs$enumeratedS2;\n // https://tools.ietf.org/html/rfc8216#section-4.3.2.4\n var keyAttrs = new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList(keyTag);\n var decryptmethod = (_keyAttrs$enumeratedS = keyAttrs.enumeratedString('METHOD')) != null ? _keyAttrs$enumeratedS : '';\n var decrypturi = keyAttrs.URI;\n var decryptiv = keyAttrs.hexadecimalInteger('IV');\n var decryptkeyformatversions = keyAttrs.enumeratedString('KEYFORMATVERSIONS');\n // From RFC: This attribute is OPTIONAL; its absence indicates an implicit value of \"identity\".\n var decryptkeyformat = (_keyAttrs$enumeratedS2 = keyAttrs.enumeratedString('KEYFORMAT')) != null ? _keyAttrs$enumeratedS2 : 'identity';\n if (decrypturi && keyAttrs.IV && !decryptiv) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_7__.logger.error(\"Invalid IV: \" + keyAttrs.IV);\n }\n // If decrypturi is a URI with a scheme, then baseurl will be ignored\n // No uri is allowed when METHOD is NONE\n var resolvedUri = decrypturi ? M3U8Parser.resolve(decrypturi, baseurl) : '';\n var keyFormatVersions = (decryptkeyformatversions ? decryptkeyformatversions : '1').split('/').map(Number).filter(Number.isFinite);\n return new _level_key__WEBPACK_IMPORTED_MODULE_5__.LevelKey(decryptmethod, resolvedUri, decryptkeyformat, keyFormatVersions, decryptiv);\n}\nfunction setCodecs(codecs, level) {\n ['video', 'audio', 'text'].forEach(function (type) {\n var filtered = codecs.filter(function (codec) {\n return (0,_utils_codecs__WEBPACK_IMPORTED_MODULE_8__.isCodecType)(codec, type);\n });\n if (filtered.length) {\n var preferred = filtered.filter(function (codec) {\n return codec.lastIndexOf('avc1', 0) === 0 || codec.lastIndexOf('mp4a', 0) === 0;\n });\n level[type + \"Codec\"] = preferred.length > 0 ? preferred[0] : filtered[0];\n\n // remove from list\n codecs = codecs.filter(function (codec) {\n return filtered.indexOf(codec) === -1;\n });\n }\n });\n level.unknownCodecs = codecs;\n}\nfunction assignCodec(media, groupItem, codecProperty) {\n var codecValue = groupItem[codecProperty];\n if (codecValue) {\n media[codecProperty] = codecValue;\n }\n}\nfunction backfillProgramDateTimes(fragments, firstPdtIndex) {\n var fragPrev = fragments[firstPdtIndex];\n for (var i = firstPdtIndex; i--;) {\n var frag = fragments[i];\n // Exit on delta-playlist skipped segments\n if (!frag) {\n return;\n }\n frag.programDateTime = fragPrev.programDateTime - frag.duration * 1000;\n fragPrev = frag;\n }\n}\nfunction assignProgramDateTime(frag, prevFrag) {\n if (frag.rawProgramDateTime) {\n frag.programDateTime = Date.parse(frag.rawProgramDateTime);\n } else if (prevFrag !== null && prevFrag !== void 0 && prevFrag.programDateTime) {\n frag.programDateTime = prevFrag.endProgramDateTime;\n }\n if (!(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(frag.programDateTime)) {\n frag.programDateTime = null;\n frag.rawProgramDateTime = null;\n }\n}\nfunction setInitSegment(frag, mapAttrs, id, levelkeys) {\n frag.relurl = mapAttrs.URI;\n if (mapAttrs.BYTERANGE) {\n frag.setByteRange(mapAttrs.BYTERANGE);\n }\n frag.level = id;\n frag.sn = 'initSegment';\n if (levelkeys) {\n frag.levelkeys = levelkeys;\n }\n frag.initSegment = null;\n}\nfunction setFragLevelKeys(frag, levelkeys, level) {\n frag.levelkeys = levelkeys;\n var encryptedFragments = level.encryptedFragments;\n if ((!encryptedFragments.length || encryptedFragments[encryptedFragments.length - 1].levelkeys !== levelkeys) && Object.keys(levelkeys).some(function (format) {\n return levelkeys[format].isCommonEncryption;\n })) {\n encryptedFragments.push(frag);\n }\n}\n\n/***/ }),\n\n/***/ \"./src/loader/playlist-loader.ts\":\n/*!***************************************!*\\\n !*** ./src/loader/playlist-loader.ts ***!\n \\***************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _m3u8_parser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./m3u8-parser */ \"./src/loader/m3u8-parser.ts\");\n/* harmony import */ var _types_loader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../types/loader */ \"./src/types/loader.ts\");\n/* harmony import */ var _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/attr-list */ \"./src/utils/attr-list.ts\");\n\n\n/**\n * PlaylistLoader - delegate for media manifest/playlist loading tasks. Takes care of parsing media to internal data-models.\n *\n * Once loaded, dispatches events with parsed data-models of manifest/levels/audio/subtitle tracks.\n *\n * Uses loader(s) set in config to do actual internal loading of resource tasks.\n *\n * @module\n *\n */\n\n\n\n\n\n\n\nfunction mapContextToLevelType(context) {\n var type = context.type;\n switch (type) {\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.AUDIO_TRACK:\n return _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistLevelType.AUDIO;\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.SUBTITLE_TRACK:\n return _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistLevelType.SUBTITLE;\n default:\n return _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistLevelType.MAIN;\n }\n}\nfunction getResponseUrl(response, context) {\n var url = response.url;\n // responseURL not supported on some browsers (it is used to detect URL redirection)\n // data-uri mode also not supported (but no need to detect redirection)\n if (url === undefined || url.indexOf('data:') === 0) {\n // fallback to initial URL\n url = context.url;\n }\n return url;\n}\nvar PlaylistLoader = /*#__PURE__*/function () {\n function PlaylistLoader(hls) {\n this.hls = void 0;\n this.loaders = Object.create(null);\n this.hls = hls;\n this.registerListeners();\n }\n var _proto = PlaylistLoader.prototype;\n _proto.startLoad = function startLoad(startPosition) {};\n _proto.stopLoad = function stopLoad() {\n this.destroyInternalLoaders();\n };\n _proto.registerListeners = function registerListeners() {\n var hls = this.hls;\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_LOADING, this.onManifestLoading, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_LOADING, this.onLevelLoading, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.AUDIO_TRACK_LOADING, this.onAudioTrackLoading, this);\n hls.on(_events__WEBPACK_IMPORTED_MODULE_1__.Events.SUBTITLE_TRACK_LOADING, this.onSubtitleTrackLoading, this);\n };\n _proto.unregisterListeners = function unregisterListeners() {\n var hls = this.hls;\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_LOADING, this.onManifestLoading, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_LOADING, this.onLevelLoading, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.AUDIO_TRACK_LOADING, this.onAudioTrackLoading, this);\n hls.off(_events__WEBPACK_IMPORTED_MODULE_1__.Events.SUBTITLE_TRACK_LOADING, this.onSubtitleTrackLoading, this);\n }\n\n /**\n * Returns defaults or configured loader-type overloads (pLoader and loader config params)\n */;\n _proto.createInternalLoader = function createInternalLoader(context) {\n var config = this.hls.config;\n var PLoader = config.pLoader;\n var Loader = config.loader;\n var InternalLoader = PLoader || Loader;\n var loader = new InternalLoader(config);\n context.loader = loader;\n this.loaders[context.type] = loader;\n return loader;\n };\n _proto.getInternalLoader = function getInternalLoader(context) {\n return this.loaders[context.type];\n };\n _proto.resetInternalLoader = function resetInternalLoader(contextType) {\n if (this.loaders[contextType]) {\n delete this.loaders[contextType];\n }\n }\n\n /**\n * Call `destroy` on all internal loader instances mapped (one per context type)\n */;\n _proto.destroyInternalLoaders = function destroyInternalLoaders() {\n for (var contextType in this.loaders) {\n var loader = this.loaders[contextType];\n if (loader) {\n loader.destroy();\n }\n this.resetInternalLoader(contextType);\n }\n };\n _proto.destroy = function destroy() {\n this.unregisterListeners();\n this.destroyInternalLoaders();\n };\n _proto.onManifestLoading = function onManifestLoading(event, data) {\n var url = data.url;\n this.load({\n id: null,\n groupId: null,\n level: 0,\n responseType: 'text',\n type: _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.MANIFEST,\n url: url,\n deliveryDirectives: null\n });\n };\n _proto.onLevelLoading = function onLevelLoading(event, data) {\n var id = data.id,\n level = data.level,\n url = data.url,\n deliveryDirectives = data.deliveryDirectives;\n this.load({\n id: id,\n groupId: null,\n level: level,\n responseType: 'text',\n type: _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.LEVEL,\n url: url,\n deliveryDirectives: deliveryDirectives\n });\n };\n _proto.onAudioTrackLoading = function onAudioTrackLoading(event, data) {\n var id = data.id,\n groupId = data.groupId,\n url = data.url,\n deliveryDirectives = data.deliveryDirectives;\n this.load({\n id: id,\n groupId: groupId,\n level: null,\n responseType: 'text',\n type: _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.AUDIO_TRACK,\n url: url,\n deliveryDirectives: deliveryDirectives\n });\n };\n _proto.onSubtitleTrackLoading = function onSubtitleTrackLoading(event, data) {\n var id = data.id,\n groupId = data.groupId,\n url = data.url,\n deliveryDirectives = data.deliveryDirectives;\n this.load({\n id: id,\n groupId: groupId,\n level: null,\n responseType: 'text',\n type: _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.SUBTITLE_TRACK,\n url: url,\n deliveryDirectives: deliveryDirectives\n });\n };\n _proto.load = function load(context) {\n var _context$deliveryDire;\n var config = this.hls.config;\n\n // logger.debug(`[playlist-loader]: Loading playlist of type ${context.type}, level: ${context.level}, id: ${context.id}`);\n\n // Check if a loader for this context already exists\n var loader = this.getInternalLoader(context);\n if (loader) {\n var loaderContext = loader.context;\n if (loaderContext && loaderContext.url === context.url) {\n // same URL can't overlap\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.trace('[playlist-loader]: playlist request ongoing');\n return;\n }\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.log(\"[playlist-loader]: aborting previous loader for type: \" + context.type);\n loader.abort();\n }\n var maxRetry;\n var timeout;\n var retryDelay;\n var maxRetryDelay;\n\n // apply different configs for retries depending on\n // context (manifest, level, audio/subs playlist)\n switch (context.type) {\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.MANIFEST:\n maxRetry = config.manifestLoadingMaxRetry;\n timeout = config.manifestLoadingTimeOut;\n retryDelay = config.manifestLoadingRetryDelay;\n maxRetryDelay = config.manifestLoadingMaxRetryTimeout;\n break;\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.LEVEL:\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.AUDIO_TRACK:\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.SUBTITLE_TRACK:\n // Manage retries in Level/Track Controller\n maxRetry = 0;\n timeout = config.levelLoadingTimeOut;\n break;\n default:\n maxRetry = config.levelLoadingMaxRetry;\n timeout = config.levelLoadingTimeOut;\n retryDelay = config.levelLoadingRetryDelay;\n maxRetryDelay = config.levelLoadingMaxRetryTimeout;\n break;\n }\n loader = this.createInternalLoader(context);\n\n // Override level/track timeout for LL-HLS requests\n // (the default of 10000ms is counter productive to blocking playlist reload requests)\n if ((_context$deliveryDire = context.deliveryDirectives) !== null && _context$deliveryDire !== void 0 && _context$deliveryDire.part) {\n var levelDetails;\n if (context.type === _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.LEVEL && context.level !== null) {\n levelDetails = this.hls.levels[context.level].details;\n } else if (context.type === _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.AUDIO_TRACK && context.id !== null) {\n levelDetails = this.hls.audioTracks[context.id].details;\n } else if (context.type === _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.SUBTITLE_TRACK && context.id !== null) {\n levelDetails = this.hls.subtitleTracks[context.id].details;\n }\n if (levelDetails) {\n var partTarget = levelDetails.partTarget;\n var targetDuration = levelDetails.targetduration;\n if (partTarget && targetDuration) {\n timeout = Math.min(Math.max(partTarget * 3, targetDuration * 0.8) * 1000, timeout);\n }\n }\n }\n var loaderConfig = {\n timeout: timeout,\n maxRetry: maxRetry,\n retryDelay: retryDelay,\n maxRetryDelay: maxRetryDelay,\n highWaterMark: 0\n };\n var loaderCallbacks = {\n onSuccess: this.loadsuccess.bind(this),\n onError: this.loaderror.bind(this),\n onTimeout: this.loadtimeout.bind(this)\n };\n\n // logger.debug(`[playlist-loader]: Calling internal loader delegate for URL: ${context.url}`);\n\n loader.load(context, loaderConfig, loaderCallbacks);\n };\n _proto.loadsuccess = function loadsuccess(response, stats, context, networkDetails) {\n if (networkDetails === void 0) {\n networkDetails = null;\n }\n this.resetInternalLoader(context.type);\n var string = response.data;\n\n // Validate if it is an M3U8 at all\n if (string.indexOf('#EXTM3U') !== 0) {\n this.handleManifestParsingError(response, context, 'no EXTM3U delimiter', networkDetails);\n return;\n }\n stats.parsing.start = performance.now();\n // Check if chunk-list or master. handle empty chunk list case (first EXTINF not signaled, but TARGETDURATION present)\n if (string.indexOf('#EXTINF:') > 0 || string.indexOf('#EXT-X-TARGETDURATION:') > 0) {\n this.handleTrackOrLevelPlaylist(response, stats, context, networkDetails);\n } else {\n this.handleMasterPlaylist(response, stats, context, networkDetails);\n }\n };\n _proto.loaderror = function loaderror(response, context, networkDetails) {\n if (networkDetails === void 0) {\n networkDetails = null;\n }\n this.handleNetworkError(context, networkDetails, false, response);\n };\n _proto.loadtimeout = function loadtimeout(stats, context, networkDetails) {\n if (networkDetails === void 0) {\n networkDetails = null;\n }\n this.handleNetworkError(context, networkDetails, true);\n };\n _proto.handleMasterPlaylist = function handleMasterPlaylist(response, stats, context, networkDetails) {\n var hls = this.hls;\n var string = response.data;\n var url = getResponseUrl(response, context);\n var _M3U8Parser$parseMast = _m3u8_parser__WEBPACK_IMPORTED_MODULE_4__[\"default\"].parseMasterPlaylist(string, url),\n levels = _M3U8Parser$parseMast.levels,\n sessionData = _M3U8Parser$parseMast.sessionData,\n sessionKeys = _M3U8Parser$parseMast.sessionKeys;\n if (!levels.length) {\n this.handleManifestParsingError(response, context, 'no level found in manifest', networkDetails);\n return;\n }\n\n // multi level playlist, parse level info\n var audioGroups = levels.map(function (level) {\n return {\n id: level.attrs.AUDIO,\n audioCodec: level.audioCodec\n };\n });\n var subtitleGroups = levels.map(function (level) {\n return {\n id: level.attrs.SUBTITLES,\n textCodec: level.textCodec\n };\n });\n var audioTracks = _m3u8_parser__WEBPACK_IMPORTED_MODULE_4__[\"default\"].parseMasterPlaylistMedia(string, url, 'AUDIO', audioGroups);\n var subtitles = _m3u8_parser__WEBPACK_IMPORTED_MODULE_4__[\"default\"].parseMasterPlaylistMedia(string, url, 'SUBTITLES', subtitleGroups);\n var captions = _m3u8_parser__WEBPACK_IMPORTED_MODULE_4__[\"default\"].parseMasterPlaylistMedia(string, url, 'CLOSED-CAPTIONS');\n if (audioTracks.length) {\n // check if we have found an audio track embedded in main playlist (audio track without URI attribute)\n var embeddedAudioFound = audioTracks.some(function (audioTrack) {\n return !audioTrack.url;\n });\n\n // if no embedded audio track defined, but audio codec signaled in quality level,\n // we need to signal this main audio track this could happen with playlists with\n // alt audio rendition in which quality levels (main)\n // contains both audio+video. but with mixed audio track not signaled\n if (!embeddedAudioFound && levels[0].audioCodec && !levels[0].attrs.AUDIO) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.log('[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one');\n audioTracks.unshift({\n type: 'main',\n name: 'main',\n default: false,\n autoselect: false,\n forced: false,\n id: -1,\n attrs: new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList({}),\n bitrate: 0,\n url: ''\n });\n }\n }\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_LOADED, {\n levels: levels,\n audioTracks: audioTracks,\n subtitles: subtitles,\n captions: captions,\n url: url,\n stats: stats,\n networkDetails: networkDetails,\n sessionData: sessionData,\n sessionKeys: sessionKeys\n });\n };\n _proto.handleTrackOrLevelPlaylist = function handleTrackOrLevelPlaylist(response, stats, context, networkDetails) {\n var hls = this.hls;\n var id = context.id,\n level = context.level,\n type = context.type;\n var url = getResponseUrl(response, context);\n var levelUrlId = (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(id) ? id : 0;\n var levelId = (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(level) ? level : levelUrlId;\n var levelType = mapContextToLevelType(context);\n var levelDetails = _m3u8_parser__WEBPACK_IMPORTED_MODULE_4__[\"default\"].parseLevelPlaylist(response.data, url, levelId, levelType, levelUrlId);\n if (!levelDetails.fragments.length) {\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorTypes.NETWORK_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.LEVEL_EMPTY_ERROR,\n fatal: false,\n url: url,\n reason: 'no fragments found in level',\n level: typeof context.level === 'number' ? context.level : undefined\n });\n return;\n }\n\n // We have done our first request (Manifest-type) and receive\n // not a master playlist but a chunk-list (track/level)\n // We fire the manifest-loaded event anyway with the parsed level-details\n // by creating a single-level structure for it.\n if (type === _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.MANIFEST) {\n var singleLevel = {\n attrs: new _utils_attr_list__WEBPACK_IMPORTED_MODULE_6__.AttrList({}),\n bitrate: 0,\n details: levelDetails,\n name: '',\n url: url\n };\n hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.MANIFEST_LOADED, {\n levels: [singleLevel],\n audioTracks: [],\n url: url,\n stats: stats,\n networkDetails: networkDetails,\n sessionData: null,\n sessionKeys: null\n });\n }\n\n // save parsing time\n stats.parsing.end = performance.now();\n\n // extend the context with the new levelDetails property\n context.levelDetails = levelDetails;\n this.handlePlaylistLoaded(response, stats, context, networkDetails);\n };\n _proto.handleManifestParsingError = function handleManifestParsingError(response, context, reason, networkDetails) {\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorTypes.NETWORK_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.MANIFEST_PARSING_ERROR,\n fatal: context.type === _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.MANIFEST,\n url: response.url,\n reason: reason,\n response: response,\n context: context,\n networkDetails: networkDetails\n });\n };\n _proto.handleNetworkError = function handleNetworkError(context, networkDetails, timeout, response) {\n if (timeout === void 0) {\n timeout = false;\n }\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.warn(\"[playlist-loader]: A network \" + (timeout ? 'timeout' : 'error') + \" occurred while loading \" + context.type + \" level: \" + context.level + \" id: \" + context.id + \" group-id: \\\"\" + context.groupId + \"\\\"\");\n var details = _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.UNKNOWN;\n var fatal = false;\n var loader = this.getInternalLoader(context);\n switch (context.type) {\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.MANIFEST:\n details = timeout ? _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.MANIFEST_LOAD_TIMEOUT : _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.MANIFEST_LOAD_ERROR;\n fatal = true;\n break;\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.LEVEL:\n details = timeout ? _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.LEVEL_LOAD_TIMEOUT : _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.LEVEL_LOAD_ERROR;\n fatal = false;\n break;\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.AUDIO_TRACK:\n details = timeout ? _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT : _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.AUDIO_TRACK_LOAD_ERROR;\n fatal = false;\n break;\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.SUBTITLE_TRACK:\n details = timeout ? _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT : _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorDetails.SUBTITLE_LOAD_ERROR;\n fatal = false;\n break;\n }\n if (loader) {\n this.resetInternalLoader(context.type);\n }\n var errorData = {\n type: _errors__WEBPACK_IMPORTED_MODULE_2__.ErrorTypes.NETWORK_ERROR,\n details: details,\n fatal: fatal,\n url: context.url,\n loader: loader,\n context: context,\n networkDetails: networkDetails\n };\n if (response) {\n errorData.response = response;\n }\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.ERROR, errorData);\n };\n _proto.handlePlaylistLoaded = function handlePlaylistLoaded(response, stats, context, networkDetails) {\n var type = context.type,\n level = context.level,\n id = context.id,\n groupId = context.groupId,\n loader = context.loader,\n levelDetails = context.levelDetails,\n deliveryDirectives = context.deliveryDirectives;\n if (!(levelDetails !== null && levelDetails !== void 0 && levelDetails.targetduration)) {\n this.handleManifestParsingError(response, context, 'invalid target duration', networkDetails);\n return;\n }\n if (!loader) {\n return;\n }\n if (levelDetails.live) {\n if (loader.getCacheAge) {\n levelDetails.ageHeader = loader.getCacheAge() || 0;\n }\n if (!loader.getCacheAge || isNaN(levelDetails.ageHeader)) {\n levelDetails.ageHeader = 0;\n }\n }\n switch (type) {\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.MANIFEST:\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.LEVEL:\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.LEVEL_LOADED, {\n details: levelDetails,\n level: level || 0,\n id: id || 0,\n stats: stats,\n networkDetails: networkDetails,\n deliveryDirectives: deliveryDirectives\n });\n break;\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.AUDIO_TRACK:\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.AUDIO_TRACK_LOADED, {\n details: levelDetails,\n id: id || 0,\n groupId: groupId || '',\n stats: stats,\n networkDetails: networkDetails,\n deliveryDirectives: deliveryDirectives\n });\n break;\n case _types_loader__WEBPACK_IMPORTED_MODULE_5__.PlaylistContextType.SUBTITLE_TRACK:\n this.hls.trigger(_events__WEBPACK_IMPORTED_MODULE_1__.Events.SUBTITLE_TRACK_LOADED, {\n details: levelDetails,\n id: id || 0,\n groupId: groupId || '',\n stats: stats,\n networkDetails: networkDetails,\n deliveryDirectives: deliveryDirectives\n });\n break;\n }\n };\n return PlaylistLoader;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PlaylistLoader);\n\n/***/ }),\n\n/***/ \"./src/polyfills/number.ts\":\n/*!*********************************!*\\\n !*** ./src/polyfills/number.ts ***!\n \\*********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MAX_SAFE_INTEGER\": () => (/* binding */ MAX_SAFE_INTEGER),\n/* harmony export */ \"isFiniteNumber\": () => (/* binding */ isFiniteNumber)\n/* harmony export */ });\nvar isFiniteNumber = Number.isFinite || function (value) {\n return typeof value === 'number' && isFinite(value);\n};\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\n\n/***/ }),\n\n/***/ \"./src/remux/aac-helper.ts\":\n/*!*********************************!*\\\n !*** ./src/remux/aac-helper.ts ***!\n \\*********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * AAC helper\n */\nvar AAC = /*#__PURE__*/function () {\n function AAC() {}\n AAC.getSilentFrame = function getSilentFrame(codec, channelCount) {\n switch (codec) {\n case 'mp4a.40.2':\n if (channelCount === 1) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x23, 0x80]);\n } else if (channelCount === 2) {\n return new Uint8Array([0x21, 0x00, 0x49, 0x90, 0x02, 0x19, 0x00, 0x23, 0x80]);\n } else if (channelCount === 3) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x8e]);\n } else if (channelCount === 4) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x80, 0x2c, 0x80, 0x08, 0x02, 0x38]);\n } else if (channelCount === 5) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x38]);\n } else if (channelCount === 6) {\n return new Uint8Array([0x00, 0xc8, 0x00, 0x80, 0x20, 0x84, 0x01, 0x26, 0x40, 0x08, 0x64, 0x00, 0x82, 0x30, 0x04, 0x99, 0x00, 0x21, 0x90, 0x02, 0x00, 0xb2, 0x00, 0x20, 0x08, 0xe0]);\n }\n break;\n // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)\n default:\n if (channelCount === 1) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0:d=0.05\" -c:a libfdk_aac -profile:a aac_he -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x4e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x1c, 0x6, 0xf1, 0xc1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n } else if (channelCount === 2) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0|0:d=0.05\" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n } else if (channelCount === 3) {\n // ffmpeg -y -f lavfi -i \"aevalsrc=0|0|0:d=0.05\" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 \"0x%x,\" \"\\n\"' -v output.aac\n return new Uint8Array([0x1, 0x40, 0x22, 0x80, 0xa3, 0x5e, 0xe6, 0x80, 0xba, 0x8, 0x0, 0x0, 0x0, 0x0, 0x95, 0x0, 0x6, 0xf1, 0xa1, 0xa, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5e]);\n }\n break;\n }\n return undefined;\n };\n return AAC;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AAC);\n\n/***/ }),\n\n/***/ \"./src/remux/mp4-generator.ts\":\n/*!************************************!*\\\n !*** ./src/remux/mp4-generator.ts ***!\n \\************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * Generate MP4 Box\n */\n\nvar UINT32_MAX = Math.pow(2, 32) - 1;\nvar MP4 = /*#__PURE__*/function () {\n function MP4() {}\n MP4.init = function init() {\n MP4.types = {\n avc1: [],\n // codingname\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [],\n '.mp3': [],\n mvex: [],\n mvhd: [],\n pasp: [],\n sdtp: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: [],\n smhd: []\n };\n var i;\n for (i in MP4.types) {\n if (MP4.types.hasOwnProperty(i)) {\n MP4.types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n }\n }\n var videoHdlr = new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x00,\n // pre_defined\n 0x76, 0x69, 0x64, 0x65,\n // handler_type: 'vide'\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n\n var audioHdlr = new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x00,\n // pre_defined\n 0x73, 0x6f, 0x75, 0x6e,\n // handler_type: 'soun'\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n\n MP4.HDLR_TYPES = {\n video: videoHdlr,\n audio: audioHdlr\n };\n var dref = new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x01,\n // entry_count\n 0x00, 0x00, 0x00, 0x0c,\n // entry_size\n 0x75, 0x72, 0x6c, 0x20,\n // 'url' type\n 0x00,\n // version 0\n 0x00, 0x00, 0x01 // entry_flags\n ]);\n\n var stco = new Uint8Array([0x00,\n // version\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n\n MP4.STTS = MP4.STSC = MP4.STCO = stco;\n MP4.STSZ = new Uint8Array([0x00,\n // version\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x00,\n // sample_size\n 0x00, 0x00, 0x00, 0x00 // sample_count\n ]);\n\n MP4.VMHD = new Uint8Array([0x00,\n // version\n 0x00, 0x00, 0x01,\n // flags\n 0x00, 0x00,\n // graphicsmode\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n ]);\n\n MP4.SMHD = new Uint8Array([0x00,\n // version\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00,\n // balance\n 0x00, 0x00 // reserved\n ]);\n\n MP4.STSD = new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x01]); // entry_count\n\n var majorBrand = new Uint8Array([105, 115, 111, 109]); // isom\n var avc1Brand = new Uint8Array([97, 118, 99, 49]); // avc1\n var minorVersion = new Uint8Array([0, 0, 0, 1]);\n MP4.FTYP = MP4.box(MP4.types.ftyp, majorBrand, minorVersion, majorBrand, avc1Brand);\n MP4.DINF = MP4.box(MP4.types.dinf, MP4.box(MP4.types.dref, dref));\n };\n MP4.box = function box(type) {\n var size = 8;\n for (var _len = arguments.length, payload = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n payload[_key - 1] = arguments[_key];\n }\n var i = payload.length;\n var len = i;\n // calculate the total size we need to allocate\n while (i--) {\n size += payload[i].byteLength;\n }\n var result = new Uint8Array(size);\n result[0] = size >> 24 & 0xff;\n result[1] = size >> 16 & 0xff;\n result[2] = size >> 8 & 0xff;\n result[3] = size & 0xff;\n result.set(type, 4);\n // copy the payload into the result\n for (i = 0, size = 8; i < len; i++) {\n // copy payload[i] array @ offset size\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n return result;\n };\n MP4.hdlr = function hdlr(type) {\n return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);\n };\n MP4.mdat = function mdat(data) {\n return MP4.box(MP4.types.mdat, data);\n };\n MP4.mdhd = function mdhd(timescale, duration) {\n duration *= timescale;\n var upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n var lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.mdhd, new Uint8Array([0x01,\n // version 1\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,\n // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,\n // modification_time\n timescale >> 24 & 0xff, timescale >> 16 & 0xff, timescale >> 8 & 0xff, timescale & 0xff,\n // timescale\n upperWordDuration >> 24, upperWordDuration >> 16 & 0xff, upperWordDuration >> 8 & 0xff, upperWordDuration & 0xff, lowerWordDuration >> 24, lowerWordDuration >> 16 & 0xff, lowerWordDuration >> 8 & 0xff, lowerWordDuration & 0xff, 0x55, 0xc4,\n // 'und' language (undetermined)\n 0x00, 0x00]));\n };\n MP4.mdia = function mdia(track) {\n return MP4.box(MP4.types.mdia, MP4.mdhd(track.timescale, track.duration), MP4.hdlr(track.type), MP4.minf(track));\n };\n MP4.mfhd = function mfhd(sequenceNumber) {\n return MP4.box(MP4.types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00,\n // flags\n sequenceNumber >> 24, sequenceNumber >> 16 & 0xff, sequenceNumber >> 8 & 0xff, sequenceNumber & 0xff // sequence_number\n ]));\n };\n MP4.minf = function minf(track) {\n if (track.type === 'audio') {\n return MP4.box(MP4.types.minf, MP4.box(MP4.types.smhd, MP4.SMHD), MP4.DINF, MP4.stbl(track));\n } else {\n return MP4.box(MP4.types.minf, MP4.box(MP4.types.vmhd, MP4.VMHD), MP4.DINF, MP4.stbl(track));\n }\n };\n MP4.moof = function moof(sn, baseMediaDecodeTime, track) {\n return MP4.box(MP4.types.moof, MP4.mfhd(sn), MP4.traf(track, baseMediaDecodeTime));\n }\n\n /**\n * @param tracks... (optional) {array} the tracks associated with this movie\n */;\n MP4.moov = function moov(tracks) {\n var i = tracks.length;\n var boxes = [];\n while (i--) {\n boxes[i] = MP4.trak(tracks[i]);\n }\n return MP4.box.apply(null, [MP4.types.moov, MP4.mvhd(tracks[0].timescale, tracks[0].duration)].concat(boxes).concat(MP4.mvex(tracks)));\n };\n MP4.mvex = function mvex(tracks) {\n var i = tracks.length;\n var boxes = [];\n while (i--) {\n boxes[i] = MP4.trex(tracks[i]);\n }\n return MP4.box.apply(null, [MP4.types.mvex].concat(boxes));\n };\n MP4.mvhd = function mvhd(timescale, duration) {\n duration *= timescale;\n var upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n var lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n var bytes = new Uint8Array([0x01,\n // version 1\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,\n // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,\n // modification_time\n timescale >> 24 & 0xff, timescale >> 16 & 0xff, timescale >> 8 & 0xff, timescale & 0xff,\n // timescale\n upperWordDuration >> 24, upperWordDuration >> 16 & 0xff, upperWordDuration >> 8 & 0xff, upperWordDuration & 0xff, lowerWordDuration >> 24, lowerWordDuration >> 16 & 0xff, lowerWordDuration >> 8 & 0xff, lowerWordDuration & 0xff, 0x00, 0x01, 0x00, 0x00,\n // 1.0 rate\n 0x01, 0x00,\n // 1.0 volume\n 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,\n // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // pre_defined\n 0xff, 0xff, 0xff, 0xff // next_track_ID\n ]);\n\n return MP4.box(MP4.types.mvhd, bytes);\n };\n MP4.sdtp = function sdtp(track) {\n var samples = track.samples || [];\n var bytes = new Uint8Array(4 + samples.length);\n var i;\n var flags;\n // leave the full box header (4 bytes) all zero\n // write the sample table\n for (i = 0; i < samples.length; i++) {\n flags = samples[i].flags;\n bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n }\n return MP4.box(MP4.types.sdtp, bytes);\n };\n MP4.stbl = function stbl(track) {\n return MP4.box(MP4.types.stbl, MP4.stsd(track), MP4.box(MP4.types.stts, MP4.STTS), MP4.box(MP4.types.stsc, MP4.STSC), MP4.box(MP4.types.stsz, MP4.STSZ), MP4.box(MP4.types.stco, MP4.STCO));\n };\n MP4.avc1 = function avc1(track) {\n var sps = [];\n var pps = [];\n var i;\n var data;\n var len;\n // assemble the SPSs\n\n for (i = 0; i < track.sps.length; i++) {\n data = track.sps[i];\n len = data.byteLength;\n sps.push(len >>> 8 & 0xff);\n sps.push(len & 0xff);\n\n // SPS\n sps = sps.concat(Array.prototype.slice.call(data));\n }\n\n // assemble the PPSs\n for (i = 0; i < track.pps.length; i++) {\n data = track.pps[i];\n len = data.byteLength;\n pps.push(len >>> 8 & 0xff);\n pps.push(len & 0xff);\n pps = pps.concat(Array.prototype.slice.call(data));\n }\n var avcc = MP4.box(MP4.types.avcC, new Uint8Array([0x01,\n // version\n sps[3],\n // profile\n sps[4],\n // profile compat\n sps[5],\n // level\n 0xfc | 3,\n // lengthSizeMinusOne, hard-coded to 4 bytes\n 0xe0 | track.sps.length // 3bit reserved (111) + numOfSequenceParameterSets\n ].concat(sps).concat([track.pps.length // numOfPictureParameterSets\n ]).concat(pps))); // \"PPS\"\n var width = track.width;\n var height = track.height;\n var hSpacing = track.pixelRatio[0];\n var vSpacing = track.pixelRatio[1];\n return MP4.box(MP4.types.avc1, new Uint8Array([0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x01,\n // data_reference_index\n 0x00, 0x00,\n // pre_defined\n 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // pre_defined\n width >> 8 & 0xff, width & 0xff,\n // width\n height >> 8 & 0xff, height & 0xff,\n // height\n 0x00, 0x48, 0x00, 0x00,\n // horizresolution\n 0x00, 0x48, 0x00, 0x00,\n // vertresolution\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x01,\n // frame_count\n 0x12, 0x64, 0x61, 0x69, 0x6c,\n // dailymotion/hls.js\n 0x79, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x68, 0x6c, 0x73, 0x2e, 0x6a, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // compressorname\n 0x00, 0x18,\n // depth = 24\n 0x11, 0x11]),\n // pre_defined = -1\n avcc, MP4.box(MP4.types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80,\n // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0,\n // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])),\n // avgBitrate\n MP4.box(MP4.types.pasp, new Uint8Array([hSpacing >> 24,\n // hSpacing\n hSpacing >> 16 & 0xff, hSpacing >> 8 & 0xff, hSpacing & 0xff, vSpacing >> 24,\n // vSpacing\n vSpacing >> 16 & 0xff, vSpacing >> 8 & 0xff, vSpacing & 0xff])));\n };\n MP4.esds = function esds(track) {\n var configlen = track.config.length;\n return new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n\n 0x03,\n // descriptor_type\n 0x17 + configlen,\n // length\n 0x00, 0x01,\n // es_id\n 0x00,\n // stream_priority\n\n 0x04,\n // descriptor_type\n 0x0f + configlen,\n // length\n 0x40,\n // codec : mpeg4_audio\n 0x15,\n // stream_type\n 0x00, 0x00, 0x00,\n // buffer_size\n 0x00, 0x00, 0x00, 0x00,\n // maxBitrate\n 0x00, 0x00, 0x00, 0x00,\n // avgBitrate\n\n 0x05 // descriptor_type\n ].concat([configlen]).concat(track.config).concat([0x06, 0x01, 0x02])); // GASpecificConfig)); // length + audio config descriptor\n };\n MP4.mp4a = function mp4a(track) {\n var samplerate = track.samplerate;\n return MP4.box(MP4.types.mp4a, new Uint8Array([0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x01,\n // data_reference_index\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, track.channelCount,\n // channelcount\n 0x00, 0x10,\n // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00,\n // reserved2\n samplerate >> 8 & 0xff, samplerate & 0xff,\n //\n 0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));\n };\n MP4.mp3 = function mp3(track) {\n var samplerate = track.samplerate;\n return MP4.box(MP4.types['.mp3'], new Uint8Array([0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x01,\n // data_reference_index\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, track.channelCount,\n // channelcount\n 0x00, 0x10,\n // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00,\n // reserved2\n samplerate >> 8 & 0xff, samplerate & 0xff,\n //\n 0x00, 0x00]));\n };\n MP4.stsd = function stsd(track) {\n if (track.type === 'audio') {\n if (track.segmentCodec === 'mp3' && track.codec === 'mp3') {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));\n }\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp4a(track));\n } else {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.avc1(track));\n }\n };\n MP4.tkhd = function tkhd(track) {\n var id = track.id;\n var duration = track.duration * track.timescale;\n var width = track.width;\n var height = track.height;\n var upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n var lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.tkhd, new Uint8Array([0x01,\n // version 1\n 0x00, 0x00, 0x07,\n // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,\n // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,\n // modification_time\n id >> 24 & 0xff, id >> 16 & 0xff, id >> 8 & 0xff, id & 0xff,\n // track_ID\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n upperWordDuration >> 24, upperWordDuration >> 16 & 0xff, upperWordDuration >> 8 & 0xff, upperWordDuration & 0xff, lowerWordDuration >> 24, lowerWordDuration >> 16 & 0xff, lowerWordDuration >> 8 & 0xff, lowerWordDuration & 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00,\n // layer\n 0x00, 0x00,\n // alternate_group\n 0x00, 0x00,\n // non-audio track volume\n 0x00, 0x00,\n // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,\n // transformation: unity matrix\n width >> 8 & 0xff, width & 0xff, 0x00, 0x00,\n // width\n height >> 8 & 0xff, height & 0xff, 0x00, 0x00 // height\n ]));\n };\n MP4.traf = function traf(track, baseMediaDecodeTime) {\n var sampleDependencyTable = MP4.sdtp(track);\n var id = track.id;\n var upperWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1));\n var lowerWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));\n return MP4.box(MP4.types.traf, MP4.box(MP4.types.tfhd, new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n id >> 24, id >> 16 & 0xff, id >> 8 & 0xff, id & 0xff // track_ID\n ])), MP4.box(MP4.types.tfdt, new Uint8Array([0x01,\n // version 1\n 0x00, 0x00, 0x00,\n // flags\n upperWordBaseMediaDecodeTime >> 24, upperWordBaseMediaDecodeTime >> 16 & 0xff, upperWordBaseMediaDecodeTime >> 8 & 0xff, upperWordBaseMediaDecodeTime & 0xff, lowerWordBaseMediaDecodeTime >> 24, lowerWordBaseMediaDecodeTime >> 16 & 0xff, lowerWordBaseMediaDecodeTime >> 8 & 0xff, lowerWordBaseMediaDecodeTime & 0xff])), MP4.trun(track, sampleDependencyTable.length + 16 +\n // tfhd\n 20 +\n // tfdt\n 8 +\n // traf header\n 16 +\n // mfhd\n 8 +\n // moof header\n 8),\n // mdat header\n sampleDependencyTable);\n }\n\n /**\n * Generate a track box.\n * @param track {object} a track definition\n * @return {Uint8Array} the track box\n */;\n MP4.trak = function trak(track) {\n track.duration = track.duration || 0xffffffff;\n return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));\n };\n MP4.trex = function trex(track) {\n var id = track.id;\n return MP4.box(MP4.types.trex, new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n id >> 24, id >> 16 & 0xff, id >> 8 & 0xff, id & 0xff,\n // track_ID\n 0x00, 0x00, 0x00, 0x01,\n // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00,\n // default_sample_duration\n 0x00, 0x00, 0x00, 0x00,\n // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]));\n };\n MP4.trun = function trun(track, offset) {\n var samples = track.samples || [];\n var len = samples.length;\n var arraylen = 12 + 16 * len;\n var array = new Uint8Array(arraylen);\n var i;\n var sample;\n var duration;\n var size;\n var flags;\n var cts;\n offset += 8 + arraylen;\n array.set([track.type === 'video' ? 0x01 : 0x00,\n // version 1 for video with signed-int sample_composition_time_offset\n 0x00, 0x0f, 0x01,\n // flags\n len >>> 24 & 0xff, len >>> 16 & 0xff, len >>> 8 & 0xff, len & 0xff,\n // sample_count\n offset >>> 24 & 0xff, offset >>> 16 & 0xff, offset >>> 8 & 0xff, offset & 0xff // data_offset\n ], 0);\n for (i = 0; i < len; i++) {\n sample = samples[i];\n duration = sample.duration;\n size = sample.size;\n flags = sample.flags;\n cts = sample.cts;\n array.set([duration >>> 24 & 0xff, duration >>> 16 & 0xff, duration >>> 8 & 0xff, duration & 0xff,\n // sample_duration\n size >>> 24 & 0xff, size >>> 16 & 0xff, size >>> 8 & 0xff, size & 0xff,\n // sample_size\n flags.isLeading << 2 | flags.dependsOn, flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.paddingValue << 1 | flags.isNonSync, flags.degradPrio & 0xf0 << 8, flags.degradPrio & 0x0f,\n // sample_flags\n cts >>> 24 & 0xff, cts >>> 16 & 0xff, cts >>> 8 & 0xff, cts & 0xff // sample_composition_time_offset\n ], 12 + 16 * i);\n }\n return MP4.box(MP4.types.trun, array);\n };\n MP4.initSegment = function initSegment(tracks) {\n if (!MP4.types) {\n MP4.init();\n }\n var movie = MP4.moov(tracks);\n var result = new Uint8Array(MP4.FTYP.byteLength + movie.byteLength);\n result.set(MP4.FTYP);\n result.set(movie, MP4.FTYP.byteLength);\n return result;\n };\n return MP4;\n}();\nMP4.types = void 0;\nMP4.HDLR_TYPES = void 0;\nMP4.STTS = void 0;\nMP4.STSC = void 0;\nMP4.STCO = void 0;\nMP4.STSZ = void 0;\nMP4.VMHD = void 0;\nMP4.SMHD = void 0;\nMP4.STSD = void 0;\nMP4.FTYP = void 0;\nMP4.DINF = void 0;\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MP4);\n\n/***/ }),\n\n/***/ \"./src/remux/mp4-remuxer.ts\":\n/*!**********************************!*\\\n !*** ./src/remux/mp4-remuxer.ts ***!\n \\**********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MP4Remuxer),\n/* harmony export */ \"flushTextTrackMetadataCueSamples\": () => (/* binding */ flushTextTrackMetadataCueSamples),\n/* harmony export */ \"flushTextTrackUserdataCueSamples\": () => (/* binding */ flushTextTrackUserdataCueSamples),\n/* harmony export */ \"normalizePts\": () => (/* binding */ normalizePts)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _aac_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./aac-helper */ \"./src/remux/aac-helper.ts\");\n/* harmony import */ var _mp4_generator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mp4-generator */ \"./src/remux/mp4-generator.ts\");\n/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../events */ \"./src/events.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../errors */ \"./src/errors.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _types_loader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../types/loader */ \"./src/types/loader.ts\");\n/* harmony import */ var _utils_timescale_conversion__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/timescale-conversion */ \"./src/utils/timescale-conversion.ts\");\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\n\n\n\n\n\n\nvar MAX_SILENT_FRAME_DURATION = 10 * 1000; // 10 seconds\nvar AAC_SAMPLES_PER_FRAME = 1024;\nvar MPEG_AUDIO_SAMPLE_PER_FRAME = 1152;\nvar chromeVersion = null;\nvar safariWebkitVersion = null;\nvar MP4Remuxer = /*#__PURE__*/function () {\n function MP4Remuxer(observer, config, typeSupported, vendor) {\n if (vendor === void 0) {\n vendor = '';\n }\n this.observer = void 0;\n this.config = void 0;\n this.typeSupported = void 0;\n this.ISGenerated = false;\n this._initPTS = void 0;\n this._initDTS = void 0;\n this.nextAvcDts = null;\n this.nextAudioPts = null;\n this.videoSampleDuration = null;\n this.isAudioContiguous = false;\n this.isVideoContiguous = false;\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n this.ISGenerated = false;\n if (chromeVersion === null) {\n var userAgent = navigator.userAgent || '';\n var result = userAgent.match(/Chrome\\/(\\d+)/i);\n chromeVersion = result ? parseInt(result[1]) : 0;\n }\n if (safariWebkitVersion === null) {\n var _result = navigator.userAgent.match(/Safari\\/(\\d+)/i);\n safariWebkitVersion = _result ? parseInt(_result[1]) : 0;\n }\n }\n var _proto = MP4Remuxer.prototype;\n _proto.destroy = function destroy() {};\n _proto.resetTimeStamp = function resetTimeStamp(defaultTimeStamp) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.log('[mp4-remuxer]: initPTS & initDTS reset');\n this._initPTS = this._initDTS = defaultTimeStamp;\n };\n _proto.resetNextTimestamp = function resetNextTimestamp() {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.log('[mp4-remuxer]: reset next timestamp');\n this.isVideoContiguous = false;\n this.isAudioContiguous = false;\n };\n _proto.resetInitSegment = function resetInitSegment() {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.log('[mp4-remuxer]: ISGenerated flag reset');\n this.ISGenerated = false;\n };\n _proto.getVideoStartPts = function getVideoStartPts(videoSamples) {\n var rolloverDetected = false;\n var startPTS = videoSamples.reduce(function (minPTS, sample) {\n var delta = sample.pts - minPTS;\n if (delta < -4294967296) {\n // 2^32, see PTSNormalize for reasoning, but we're hitting a rollover here, and we don't want that to impact the timeOffset calculation\n rolloverDetected = true;\n return normalizePts(minPTS, sample.pts);\n } else if (delta > 0) {\n return minPTS;\n } else {\n return sample.pts;\n }\n }, videoSamples[0].pts);\n if (rolloverDetected) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.debug('PTS rollover detected');\n }\n return startPTS;\n };\n _proto.remux = function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, accurateTimeOffset, flush, playlistType) {\n var video;\n var audio;\n var initSegment;\n var text;\n var id3;\n var independent;\n var audioTimeOffset = timeOffset;\n var videoTimeOffset = timeOffset;\n\n // If we're remuxing audio and video progressively, wait until we've received enough samples for each track before proceeding.\n // This is done to synchronize the audio and video streams. We know if the current segment will have samples if the \"pid\"\n // parameter is greater than -1. The pid is set when the PMT is parsed, which contains the tracks list.\n // However, if the initSegment has already been generated, or we've reached the end of a segment (flush),\n // then we can remux one track without waiting for the other.\n var hasAudio = audioTrack.pid > -1;\n var hasVideo = videoTrack.pid > -1;\n var length = videoTrack.samples.length;\n var enoughAudioSamples = audioTrack.samples.length > 0;\n var enoughVideoSamples = flush && length > 0 || length > 1;\n var canRemuxAvc = (!hasAudio || enoughAudioSamples) && (!hasVideo || enoughVideoSamples) || this.ISGenerated || flush;\n if (canRemuxAvc) {\n if (!this.ISGenerated) {\n initSegment = this.generateIS(audioTrack, videoTrack, timeOffset);\n }\n var isVideoContiguous = this.isVideoContiguous;\n var firstKeyFrameIndex = -1;\n var firstKeyFramePTS;\n if (enoughVideoSamples) {\n firstKeyFrameIndex = findKeyframeIndex(videoTrack.samples);\n if (!isVideoContiguous && this.config.forceKeyFrameOnDiscontinuity) {\n independent = true;\n if (firstKeyFrameIndex > 0) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.warn(\"[mp4-remuxer]: Dropped \" + firstKeyFrameIndex + \" out of \" + length + \" video samples due to a missing keyframe\");\n var startPTS = this.getVideoStartPts(videoTrack.samples);\n videoTrack.samples = videoTrack.samples.slice(firstKeyFrameIndex);\n videoTrack.dropped += firstKeyFrameIndex;\n videoTimeOffset += (videoTrack.samples[0].pts - startPTS) / videoTrack.inputTimeScale;\n firstKeyFramePTS = videoTimeOffset;\n } else if (firstKeyFrameIndex === -1) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.warn(\"[mp4-remuxer]: No keyframe found out of \" + length + \" video samples\");\n independent = false;\n }\n }\n }\n if (this.ISGenerated) {\n if (enoughAudioSamples && enoughVideoSamples) {\n // timeOffset is expected to be the offset of the first timestamp of this fragment (first DTS)\n // if first audio DTS is not aligned with first video DTS then we need to take that into account\n // when providing timeOffset to remuxAudio / remuxVideo. if we don't do that, there might be a permanent / small\n // drift between audio and video streams\n var _startPTS = this.getVideoStartPts(videoTrack.samples);\n var tsDelta = normalizePts(audioTrack.samples[0].pts, _startPTS) - _startPTS;\n var audiovideoTimestampDelta = tsDelta / videoTrack.inputTimeScale;\n audioTimeOffset += Math.max(0, audiovideoTimestampDelta);\n videoTimeOffset += Math.max(0, -audiovideoTimestampDelta);\n }\n\n // Purposefully remuxing audio before video, so that remuxVideo can use nextAudioPts, which is calculated in remuxAudio.\n if (enoughAudioSamples) {\n // if initSegment was generated without audio samples, regenerate it again\n if (!audioTrack.samplerate) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.warn('[mp4-remuxer]: regenerate InitSegment as audio detected');\n initSegment = this.generateIS(audioTrack, videoTrack, timeOffset);\n }\n audio = this.remuxAudio(audioTrack, audioTimeOffset, this.isAudioContiguous, accurateTimeOffset, hasVideo || enoughVideoSamples || playlistType === _types_loader__WEBPACK_IMPORTED_MODULE_6__.PlaylistLevelType.AUDIO ? videoTimeOffset : undefined);\n if (enoughVideoSamples) {\n var audioTrackLength = audio ? audio.endPTS - audio.startPTS : 0;\n // if initSegment was generated without video samples, regenerate it again\n if (!videoTrack.inputTimeScale) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.warn('[mp4-remuxer]: regenerate InitSegment as video detected');\n initSegment = this.generateIS(audioTrack, videoTrack, timeOffset);\n }\n video = this.remuxVideo(videoTrack, videoTimeOffset, isVideoContiguous, audioTrackLength);\n }\n } else if (enoughVideoSamples) {\n video = this.remuxVideo(videoTrack, videoTimeOffset, isVideoContiguous, 0);\n }\n if (video) {\n video.firstKeyFrame = firstKeyFrameIndex;\n video.independent = firstKeyFrameIndex !== -1;\n video.firstKeyFramePTS = firstKeyFramePTS;\n }\n }\n }\n\n // Allow ID3 and text to remux, even if more audio/video samples are required\n if (this.ISGenerated) {\n if (id3Track.samples.length) {\n id3 = flushTextTrackMetadataCueSamples(id3Track, timeOffset, this._initPTS, this._initDTS);\n }\n if (textTrack.samples.length) {\n text = flushTextTrackUserdataCueSamples(textTrack, timeOffset, this._initPTS);\n }\n }\n return {\n audio: audio,\n video: video,\n initSegment: initSegment,\n independent: independent,\n text: text,\n id3: id3\n };\n };\n _proto.generateIS = function generateIS(audioTrack, videoTrack, timeOffset) {\n var audioSamples = audioTrack.samples;\n var videoSamples = videoTrack.samples;\n var typeSupported = this.typeSupported;\n var tracks = {};\n var computePTSDTS = !(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(this._initPTS);\n var container = 'audio/mp4';\n var initPTS;\n var initDTS;\n var timescale;\n if (computePTSDTS) {\n initPTS = initDTS = Infinity;\n }\n if (audioTrack.config && audioSamples.length) {\n // let's use audio sampling rate as MP4 time scale.\n // rationale is that there is a integer nb of audio frames per audio sample (1024 for AAC)\n // using audio sampling rate here helps having an integer MP4 frame duration\n // this avoids potential rounding issue and AV sync issue\n audioTrack.timescale = audioTrack.samplerate;\n switch (audioTrack.segmentCodec) {\n case 'mp3':\n if (typeSupported.mpeg) {\n // Chrome and Safari\n container = 'audio/mpeg';\n audioTrack.codec = '';\n } else if (typeSupported.mp3) {\n // Firefox\n audioTrack.codec = 'mp3';\n }\n break;\n }\n tracks.audio = {\n id: 'audio',\n container: container,\n codec: audioTrack.codec,\n initSegment: audioTrack.segmentCodec === 'mp3' && typeSupported.mpeg ? new Uint8Array(0) : _mp4_generator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].initSegment([audioTrack]),\n metadata: {\n channelCount: audioTrack.channelCount\n }\n };\n if (computePTSDTS) {\n timescale = audioTrack.inputTimeScale;\n // remember first PTS of this demuxing context. for audio, PTS = DTS\n initPTS = initDTS = audioSamples[0].pts - Math.round(timescale * timeOffset);\n }\n }\n if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n // let's use input time scale as MP4 video timescale\n // we use input time scale straight away to avoid rounding issues on frame duration / cts computation\n videoTrack.timescale = videoTrack.inputTimeScale;\n tracks.video = {\n id: 'main',\n container: 'video/mp4',\n codec: videoTrack.codec,\n initSegment: _mp4_generator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].initSegment([videoTrack]),\n metadata: {\n width: videoTrack.width,\n height: videoTrack.height\n }\n };\n if (computePTSDTS) {\n timescale = videoTrack.inputTimeScale;\n var startPTS = this.getVideoStartPts(videoSamples);\n var startOffset = Math.round(timescale * timeOffset);\n initDTS = Math.min(initDTS, normalizePts(videoSamples[0].dts, startPTS) - startOffset);\n initPTS = Math.min(initPTS, startPTS - startOffset);\n }\n }\n if (Object.keys(tracks).length) {\n this.ISGenerated = true;\n if (computePTSDTS) {\n this._initPTS = initPTS;\n this._initDTS = initDTS;\n }\n return {\n tracks: tracks,\n initPTS: initPTS,\n timescale: timescale\n };\n }\n };\n _proto.remuxVideo = function remuxVideo(track, timeOffset, contiguous, audioTrackLength) {\n var timeScale = track.inputTimeScale;\n var inputSamples = track.samples;\n var outputSamples = [];\n var nbSamples = inputSamples.length;\n var initPTS = this._initPTS;\n var nextAvcDts = this.nextAvcDts;\n var offset = 8;\n var mp4SampleDuration = this.videoSampleDuration;\n var firstDTS;\n var lastDTS;\n var minPTS = Number.POSITIVE_INFINITY;\n var maxPTS = Number.NEGATIVE_INFINITY;\n var sortSamples = false;\n\n // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n if (!contiguous || nextAvcDts === null) {\n var pts = timeOffset * timeScale;\n var cts = inputSamples[0].pts - normalizePts(inputSamples[0].dts, inputSamples[0].pts);\n // if not contiguous, let's use target timeOffset\n nextAvcDts = pts - cts;\n }\n\n // PTS is coded on 33bits, and can loop from -2^32 to 2^32\n // PTSNormalize will make PTS/DTS value monotonic, we use last known DTS value as reference value\n for (var i = 0; i < nbSamples; i++) {\n var sample = inputSamples[i];\n sample.pts = normalizePts(sample.pts - initPTS, nextAvcDts);\n sample.dts = normalizePts(sample.dts - initPTS, nextAvcDts);\n if (sample.dts < inputSamples[i > 0 ? i - 1 : i].dts) {\n sortSamples = true;\n }\n }\n\n // sort video samples by DTS then PTS then demux id order\n if (sortSamples) {\n inputSamples.sort(function (a, b) {\n var deltadts = a.dts - b.dts;\n var deltapts = a.pts - b.pts;\n return deltadts || deltapts;\n });\n }\n\n // Get first/last DTS\n firstDTS = inputSamples[0].dts;\n lastDTS = inputSamples[inputSamples.length - 1].dts;\n\n // Sample duration (as expected by trun MP4 boxes), should be the delta between sample DTS\n // set this constant duration as being the avg delta between consecutive DTS.\n var inputDuration = lastDTS - firstDTS;\n var averageSampleDuration = inputDuration ? Math.round(inputDuration / (nbSamples - 1)) : mp4SampleDuration || track.inputTimeScale / 30;\n\n // if fragment are contiguous, detect hole/overlapping between fragments\n if (contiguous) {\n // check timestamp continuity across consecutive fragments (this is to remove inter-fragment gap/hole)\n var delta = firstDTS - nextAvcDts;\n var foundHole = delta > averageSampleDuration;\n var foundOverlap = delta < -1;\n if (foundHole || foundOverlap) {\n if (foundHole) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.warn(\"AVC: \" + (0,_utils_timescale_conversion__WEBPACK_IMPORTED_MODULE_7__.toMsFromMpegTsClock)(delta, true) + \" ms (\" + delta + \"dts) hole between fragments detected, filling it\");\n } else {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.warn(\"AVC: \" + (0,_utils_timescale_conversion__WEBPACK_IMPORTED_MODULE_7__.toMsFromMpegTsClock)(-delta, true) + \" ms (\" + delta + \"dts) overlapping between fragments detected\");\n }\n if (!foundOverlap || nextAvcDts > inputSamples[0].pts) {\n firstDTS = nextAvcDts;\n var firstPTS = inputSamples[0].pts - delta;\n inputSamples[0].dts = firstDTS;\n inputSamples[0].pts = firstPTS;\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.log(\"Video: First PTS/DTS adjusted: \" + (0,_utils_timescale_conversion__WEBPACK_IMPORTED_MODULE_7__.toMsFromMpegTsClock)(firstPTS, true) + \"/\" + (0,_utils_timescale_conversion__WEBPACK_IMPORTED_MODULE_7__.toMsFromMpegTsClock)(firstDTS, true) + \", delta: \" + (0,_utils_timescale_conversion__WEBPACK_IMPORTED_MODULE_7__.toMsFromMpegTsClock)(delta, true) + \" ms\");\n }\n }\n }\n firstDTS = Math.max(0, firstDTS);\n var nbNalu = 0;\n var naluLen = 0;\n for (var _i = 0; _i < nbSamples; _i++) {\n // compute total/avc sample length and nb of NAL units\n var _sample = inputSamples[_i];\n var units = _sample.units;\n var nbUnits = units.length;\n var sampleLen = 0;\n for (var j = 0; j < nbUnits; j++) {\n sampleLen += units[j].data.length;\n }\n naluLen += sampleLen;\n nbNalu += nbUnits;\n _sample.length = sampleLen;\n\n // ensure sample monotonic DTS\n _sample.dts = Math.max(_sample.dts, firstDTS);\n minPTS = Math.min(_sample.pts, minPTS);\n maxPTS = Math.max(_sample.pts, maxPTS);\n }\n lastDTS = inputSamples[nbSamples - 1].dts;\n\n /* concatenate the video data and construct the mdat in place\n (need 8 more bytes to fill length and mpdat type) */\n var mdatSize = naluLen + 4 * nbNalu + 8;\n var mdat;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n this.observer.emit(_events__WEBPACK_IMPORTED_MODULE_3__.Events.ERROR, _events__WEBPACK_IMPORTED_MODULE_3__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_4__.ErrorTypes.MUX_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_4__.ErrorDetails.REMUX_ALLOC_ERROR,\n fatal: false,\n bytes: mdatSize,\n reason: \"fail allocating video mdat \" + mdatSize\n });\n return;\n }\n var view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4_generator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].types.mdat, 4);\n var stretchedLastFrame = false;\n var minDtsDelta = Number.POSITIVE_INFINITY;\n var minPtsDelta = Number.POSITIVE_INFINITY;\n var maxDtsDelta = Number.NEGATIVE_INFINITY;\n var maxPtsDelta = Number.NEGATIVE_INFINITY;\n for (var _i2 = 0; _i2 < nbSamples; _i2++) {\n var avcSample = inputSamples[_i2];\n var avcSampleUnits = avcSample.units;\n var mp4SampleLength = 0;\n // convert NALU bitstream to MP4 format (prepend NALU with size field)\n for (var _j = 0, _nbUnits = avcSampleUnits.length; _j < _nbUnits; _j++) {\n var unit = avcSampleUnits[_j];\n var unitData = unit.data;\n var unitDataLen = unit.data.byteLength;\n view.setUint32(offset, unitDataLen);\n offset += 4;\n mdat.set(unitData, offset);\n offset += unitDataLen;\n mp4SampleLength += 4 + unitDataLen;\n }\n\n // expected sample duration is the Decoding Timestamp diff of consecutive samples\n var ptsDelta = void 0;\n if (_i2 < nbSamples - 1) {\n mp4SampleDuration = inputSamples[_i2 + 1].dts - avcSample.dts;\n ptsDelta = inputSamples[_i2 + 1].pts - avcSample.pts;\n } else {\n var config = this.config;\n var lastFrameDuration = _i2 > 0 ? avcSample.dts - inputSamples[_i2 - 1].dts : averageSampleDuration;\n ptsDelta = _i2 > 0 ? avcSample.pts - inputSamples[_i2 - 1].pts : averageSampleDuration;\n if (config.stretchShortVideoTrack && this.nextAudioPts !== null) {\n // In some cases, a segment's audio track duration may exceed the video track duration.\n // Since we've already remuxed audio, and we know how long the audio track is, we look to\n // see if the delta to the next segment is longer than maxBufferHole.\n // If so, playback would potentially get stuck, so we artificially inflate\n // the duration of the last frame to minimize any potential gap between segments.\n var gapTolerance = Math.floor(config.maxBufferHole * timeScale);\n var deltaToFrameEnd = (audioTrackLength ? minPTS + audioTrackLength * timeScale : this.nextAudioPts) - avcSample.pts;\n if (deltaToFrameEnd > gapTolerance) {\n // We subtract lastFrameDuration from deltaToFrameEnd to try to prevent any video\n // frame overlap. maxBufferHole should be >> lastFrameDuration anyway.\n mp4SampleDuration = deltaToFrameEnd - lastFrameDuration;\n if (mp4SampleDuration < 0) {\n mp4SampleDuration = lastFrameDuration;\n } else {\n stretchedLastFrame = true;\n }\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.log(\"[mp4-remuxer]: It is approximately \" + deltaToFrameEnd / 90 + \" ms to the next segment; using duration \" + mp4SampleDuration / 90 + \" ms for the last video frame.\");\n } else {\n mp4SampleDuration = lastFrameDuration;\n }\n } else {\n mp4SampleDuration = lastFrameDuration;\n }\n }\n var compositionTimeOffset = Math.round(avcSample.pts - avcSample.dts);\n minDtsDelta = Math.min(minDtsDelta, mp4SampleDuration);\n maxDtsDelta = Math.max(maxDtsDelta, mp4SampleDuration);\n minPtsDelta = Math.min(minPtsDelta, ptsDelta);\n maxPtsDelta = Math.max(maxPtsDelta, ptsDelta);\n outputSamples.push(new Mp4Sample(avcSample.key, mp4SampleDuration, mp4SampleLength, compositionTimeOffset));\n }\n if (outputSamples.length) {\n if (chromeVersion) {\n if (chromeVersion < 70) {\n // Chrome workaround, mark first sample as being a Random Access Point (keyframe) to avoid sourcebuffer append issue\n // https://code.google.com/p/chromium/issues/detail?id=229412\n var flags = outputSamples[0].flags;\n flags.dependsOn = 2;\n flags.isNonSync = 0;\n }\n } else if (safariWebkitVersion) {\n // Fix for \"CNN special report, with CC\" in test-streams (Safari browser only)\n // Ignore DTS when frame durations are irregular. Safari MSE does not handle this leading to gaps.\n if (maxPtsDelta - minPtsDelta < maxDtsDelta - minDtsDelta && averageSampleDuration / maxDtsDelta < 0.025 && outputSamples[0].cts === 0) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.warn('Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.');\n var dts = firstDTS;\n for (var _i3 = 0, len = outputSamples.length; _i3 < len; _i3++) {\n var nextDts = dts + outputSamples[_i3].duration;\n var _pts = dts + outputSamples[_i3].cts;\n if (_i3 < len - 1) {\n var nextPts = nextDts + outputSamples[_i3 + 1].cts;\n outputSamples[_i3].duration = nextPts - _pts;\n } else {\n outputSamples[_i3].duration = _i3 ? outputSamples[_i3 - 1].duration : averageSampleDuration;\n }\n outputSamples[_i3].cts = 0;\n dts = nextDts;\n }\n }\n }\n }\n console.assert(mp4SampleDuration !== null, 'mp4SampleDuration must be computed');\n // next AVC sample DTS should be equal to last sample DTS + last sample duration (in PES timescale)\n mp4SampleDuration = stretchedLastFrame || !mp4SampleDuration ? averageSampleDuration : mp4SampleDuration;\n this.nextAvcDts = nextAvcDts = lastDTS + mp4SampleDuration;\n this.videoSampleDuration = mp4SampleDuration;\n this.isVideoContiguous = true;\n var moof = _mp4_generator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].moof(track.sequenceNumber++, firstDTS, _extends({}, track, {\n samples: outputSamples\n }));\n var type = 'video';\n var data = {\n data1: moof,\n data2: mdat,\n startPTS: minPTS / timeScale,\n endPTS: (maxPTS + mp4SampleDuration) / timeScale,\n startDTS: firstDTS / timeScale,\n endDTS: nextAvcDts / timeScale,\n type: type,\n hasAudio: false,\n hasVideo: true,\n nb: outputSamples.length,\n dropped: track.dropped\n };\n track.samples = [];\n track.dropped = 0;\n console.assert(mdat.length, 'MDAT length must not be zero');\n return data;\n };\n _proto.remuxAudio = function remuxAudio(track, timeOffset, contiguous, accurateTimeOffset, videoTimeOffset) {\n var inputTimeScale = track.inputTimeScale;\n var mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale;\n var scaleFactor = inputTimeScale / mp4timeScale;\n var mp4SampleDuration = track.segmentCodec === 'aac' ? AAC_SAMPLES_PER_FRAME : MPEG_AUDIO_SAMPLE_PER_FRAME;\n var inputSampleDuration = mp4SampleDuration * scaleFactor;\n var initPTS = this._initPTS;\n var rawMPEG = track.segmentCodec === 'mp3' && this.typeSupported.mpeg;\n var outputSamples = [];\n var alignedWithVideo = videoTimeOffset !== undefined;\n var inputSamples = track.samples;\n var offset = rawMPEG ? 0 : 8;\n var nextAudioPts = this.nextAudioPts || -1;\n\n // window.audioSamples ? window.audioSamples.push(inputSamples.map(s => s.pts)) : (window.audioSamples = [inputSamples.map(s => s.pts)]);\n\n // for audio samples, also consider consecutive fragments as being contiguous (even if a level switch occurs),\n // for sake of clarity:\n // consecutive fragments are frags with\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 20 audio frames distance\n // contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)\n // this helps ensuring audio continuity\n // and this also avoids audio glitches/cut when switching quality, or reporting wrong duration on first audio frame\n var timeOffsetMpegTS = timeOffset * inputTimeScale;\n this.isAudioContiguous = contiguous = contiguous || inputSamples.length && nextAudioPts > 0 && (accurateTimeOffset && Math.abs(timeOffsetMpegTS - nextAudioPts) < 9000 || Math.abs(normalizePts(inputSamples[0].pts - initPTS, timeOffsetMpegTS) - nextAudioPts) < 20 * inputSampleDuration);\n\n // compute normalized PTS\n inputSamples.forEach(function (sample) {\n sample.pts = normalizePts(sample.pts - initPTS, timeOffsetMpegTS);\n });\n if (!contiguous || nextAudioPts < 0) {\n // filter out sample with negative PTS that are not playable anyway\n // if we don't remove these negative samples, they will shift all audio samples forward.\n // leading to audio overlap between current / next fragment\n inputSamples = inputSamples.filter(function (sample) {\n return sample.pts >= 0;\n });\n\n // in case all samples have negative PTS, and have been filtered out, return now\n if (!inputSamples.length) {\n return;\n }\n if (videoTimeOffset === 0) {\n // Set the start to 0 to match video so that start gaps larger than inputSampleDuration are filled with silence\n nextAudioPts = 0;\n } else if (accurateTimeOffset && !alignedWithVideo) {\n // When not seeking, not live, and LevelDetails.PTSKnown, use fragment start as predicted next audio PTS\n nextAudioPts = Math.max(0, timeOffsetMpegTS);\n } else {\n // if frags are not contiguous and if we cant trust time offset, let's use first sample PTS as next audio PTS\n nextAudioPts = inputSamples[0].pts;\n }\n }\n\n // If the audio track is missing samples, the frames seem to get \"left-shifted\" within the\n // resulting mp4 segment, causing sync issues and leaving gaps at the end of the audio segment.\n // In an effort to prevent this from happening, we inject frames here where there are gaps.\n // When possible, we inject a silent frame; when that's not possible, we duplicate the last\n // frame.\n\n if (track.segmentCodec === 'aac') {\n var maxAudioFramesDrift = this.config.maxAudioFramesDrift;\n for (var i = 0, nextPts = nextAudioPts; i < inputSamples.length; i++) {\n // First, let's see how far off this frame is from where we expect it to be\n var sample = inputSamples[i];\n var pts = sample.pts;\n var delta = pts - nextPts;\n var duration = Math.abs(1000 * delta / inputTimeScale);\n\n // When remuxing with video, if we're overlapping by more than a duration, drop this sample to stay in sync\n if (delta <= -maxAudioFramesDrift * inputSampleDuration && alignedWithVideo) {\n if (i === 0) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.warn(\"Audio frame @ \" + (pts / inputTimeScale).toFixed(3) + \"s overlaps nextAudioPts by \" + Math.round(1000 * delta / inputTimeScale) + \" ms.\");\n this.nextAudioPts = nextAudioPts = nextPts = pts;\n }\n } // eslint-disable-line brace-style\n\n // Insert missing frames if:\n // 1: We're more than maxAudioFramesDrift frame away\n // 2: Not more than MAX_SILENT_FRAME_DURATION away\n // 3: currentTime (aka nextPtsNorm) is not 0\n // 4: remuxing with video (videoTimeOffset !== undefined)\n else if (delta >= maxAudioFramesDrift * inputSampleDuration && duration < MAX_SILENT_FRAME_DURATION && alignedWithVideo) {\n var missing = Math.round(delta / inputSampleDuration);\n // Adjust nextPts so that silent samples are aligned with media pts. This will prevent media samples from\n // later being shifted if nextPts is based on timeOffset and delta is not a multiple of inputSampleDuration.\n nextPts = pts - missing * inputSampleDuration;\n if (nextPts < 0) {\n missing--;\n nextPts += inputSampleDuration;\n }\n if (i === 0) {\n this.nextAudioPts = nextAudioPts = nextPts;\n }\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.warn(\"[mp4-remuxer]: Injecting \" + missing + \" audio frame @ \" + (nextPts / inputTimeScale).toFixed(3) + \"s due to \" + Math.round(1000 * delta / inputTimeScale) + \" ms gap.\");\n for (var j = 0; j < missing; j++) {\n var newStamp = Math.max(nextPts, 0);\n var fillFrame = _aac_helper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.log('[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead.');\n fillFrame = sample.unit.subarray();\n }\n inputSamples.splice(i, 0, {\n unit: fillFrame,\n pts: newStamp\n });\n nextPts += inputSampleDuration;\n i++;\n }\n }\n sample.pts = nextPts;\n nextPts += inputSampleDuration;\n }\n }\n var firstPTS = null;\n var lastPTS = null;\n var mdat;\n var mdatSize = 0;\n var sampleLength = inputSamples.length;\n while (sampleLength--) {\n mdatSize += inputSamples[sampleLength].unit.byteLength;\n }\n for (var _j2 = 0, _nbSamples = inputSamples.length; _j2 < _nbSamples; _j2++) {\n var audioSample = inputSamples[_j2];\n var unit = audioSample.unit;\n var _pts2 = audioSample.pts;\n if (lastPTS !== null) {\n // If we have more than one sample, set the duration of the sample to the \"real\" duration; the PTS diff with\n // the previous sample\n var prevSample = outputSamples[_j2 - 1];\n prevSample.duration = Math.round((_pts2 - lastPTS) / scaleFactor);\n } else {\n if (contiguous && track.segmentCodec === 'aac') {\n // set PTS/DTS to expected PTS/DTS\n _pts2 = nextAudioPts;\n }\n // remember first PTS of our audioSamples\n firstPTS = _pts2;\n if (mdatSize > 0) {\n /* concatenate the audio data and construct the mdat in place\n (need 8 more bytes to fill length and mdat type) */\n mdatSize += offset;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n this.observer.emit(_events__WEBPACK_IMPORTED_MODULE_3__.Events.ERROR, _events__WEBPACK_IMPORTED_MODULE_3__.Events.ERROR, {\n type: _errors__WEBPACK_IMPORTED_MODULE_4__.ErrorTypes.MUX_ERROR,\n details: _errors__WEBPACK_IMPORTED_MODULE_4__.ErrorDetails.REMUX_ALLOC_ERROR,\n fatal: false,\n bytes: mdatSize,\n reason: \"fail allocating audio mdat \" + mdatSize\n });\n return;\n }\n if (!rawMPEG) {\n var view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4_generator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].types.mdat, 4);\n }\n } else {\n // no audio samples\n return;\n }\n }\n mdat.set(unit, offset);\n var unitLen = unit.byteLength;\n offset += unitLen;\n // Default the sample's duration to the computed mp4SampleDuration, which will either be 1024 for AAC or 1152 for MPEG\n // In the case that we have 1 sample, this will be the duration. If we have more than one sample, the duration\n // becomes the PTS diff with the previous sample\n outputSamples.push(new Mp4Sample(true, mp4SampleDuration, unitLen, 0));\n lastPTS = _pts2;\n }\n\n // We could end up with no audio samples if all input samples were overlapping with the previously remuxed ones\n var nbSamples = outputSamples.length;\n if (!nbSamples) {\n return;\n }\n\n // The next audio sample PTS should be equal to last sample PTS + duration\n var lastSample = outputSamples[outputSamples.length - 1];\n this.nextAudioPts = nextAudioPts = lastPTS + scaleFactor * lastSample.duration;\n\n // Set the track samples from inputSamples to outputSamples before remuxing\n var moof = rawMPEG ? new Uint8Array(0) : _mp4_generator__WEBPACK_IMPORTED_MODULE_2__[\"default\"].moof(track.sequenceNumber++, firstPTS / scaleFactor, _extends({}, track, {\n samples: outputSamples\n }));\n\n // Clear the track samples. This also clears the samples array in the demuxer, since the reference is shared\n track.samples = [];\n var start = firstPTS / inputTimeScale;\n var end = nextAudioPts / inputTimeScale;\n var type = 'audio';\n var audioData = {\n data1: moof,\n data2: mdat,\n startPTS: start,\n endPTS: end,\n startDTS: start,\n endDTS: end,\n type: type,\n hasAudio: true,\n hasVideo: false,\n nb: nbSamples\n };\n this.isAudioContiguous = true;\n console.assert(mdat.length, 'MDAT length must not be zero');\n return audioData;\n };\n _proto.remuxEmptyAudio = function remuxEmptyAudio(track, timeOffset, contiguous, videoData) {\n var inputTimeScale = track.inputTimeScale;\n var mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale;\n var scaleFactor = inputTimeScale / mp4timeScale;\n var nextAudioPts = this.nextAudioPts;\n // sync with video's timestamp\n var startDTS = (nextAudioPts !== null ? nextAudioPts : videoData.startDTS * inputTimeScale) + this._initDTS;\n var endDTS = videoData.endDTS * inputTimeScale + this._initDTS;\n // one sample's duration value\n var frameDuration = scaleFactor * AAC_SAMPLES_PER_FRAME;\n // samples count of this segment's duration\n var nbSamples = Math.ceil((endDTS - startDTS) / frameDuration);\n // silent frame\n var silentFrame = _aac_helper__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.warn('[mp4-remuxer]: remux empty Audio');\n // Can't remux if we can't generate a silent frame...\n if (!silentFrame) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_5__.logger.trace('[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec');\n return;\n }\n var samples = [];\n for (var i = 0; i < nbSamples; i++) {\n var stamp = startDTS + i * frameDuration;\n samples.push({\n unit: silentFrame,\n pts: stamp,\n dts: stamp\n });\n }\n track.samples = samples;\n return this.remuxAudio(track, timeOffset, contiguous, false);\n };\n return MP4Remuxer;\n}();\n\nfunction normalizePts(value, reference) {\n var offset;\n if (reference === null) {\n return value;\n }\n if (reference < value) {\n // - 2^33\n offset = -8589934592;\n } else {\n // + 2^33\n offset = 8589934592;\n }\n /* PTS is 33bit (from 0 to 2^33 -1)\n if diff between value and reference is bigger than half of the amplitude (2^32) then it means that\n PTS looping occured. fill the gap */\n while (Math.abs(value - reference) > 4294967296) {\n value += offset;\n }\n return value;\n}\nfunction findKeyframeIndex(samples) {\n for (var i = 0; i < samples.length; i++) {\n if (samples[i].key) {\n return i;\n }\n }\n return -1;\n}\nfunction flushTextTrackMetadataCueSamples(track, timeOffset, initPTS, initDTS) {\n var length = track.samples.length;\n if (!length) {\n return;\n }\n var inputTimeScale = track.inputTimeScale;\n for (var index = 0; index < length; index++) {\n var sample = track.samples[index];\n // setting id3 pts, dts to relative time\n // using this._initPTS and this._initDTS to calculate relative time\n sample.pts = normalizePts(sample.pts - initPTS, timeOffset * inputTimeScale) / inputTimeScale;\n sample.dts = normalizePts(sample.dts - initDTS, timeOffset * inputTimeScale) / inputTimeScale;\n }\n var samples = track.samples;\n track.samples = [];\n return {\n samples: samples\n };\n}\nfunction flushTextTrackUserdataCueSamples(track, timeOffset, initPTS) {\n var length = track.samples.length;\n if (!length) {\n return;\n }\n var inputTimeScale = track.inputTimeScale;\n for (var index = 0; index < length; index++) {\n var sample = track.samples[index];\n // setting text pts, dts to relative time\n // using this._initPTS and this._initDTS to calculate relative time\n sample.pts = normalizePts(sample.pts - initPTS, timeOffset * inputTimeScale) / inputTimeScale;\n }\n track.samples.sort(function (a, b) {\n return a.pts - b.pts;\n });\n var samples = track.samples;\n track.samples = [];\n return {\n samples: samples\n };\n}\nvar Mp4Sample = function Mp4Sample(isKeyframe, duration, size, cts) {\n this.size = void 0;\n this.duration = void 0;\n this.cts = void 0;\n this.flags = void 0;\n this.duration = duration;\n this.size = size;\n this.cts = cts;\n this.flags = new Mp4SampleFlags(isKeyframe);\n};\nvar Mp4SampleFlags = function Mp4SampleFlags(isKeyframe) {\n this.isLeading = 0;\n this.isDependedOn = 0;\n this.hasRedundancy = 0;\n this.degradPrio = 0;\n this.dependsOn = 1;\n this.isNonSync = 1;\n this.dependsOn = isKeyframe ? 2 : 1;\n this.isNonSync = isKeyframe ? 0 : 1;\n};\n\n/***/ }),\n\n/***/ \"./src/remux/passthrough-remuxer.ts\":\n/*!******************************************!*\\\n !*** ./src/remux/passthrough-remuxer.ts ***!\n \\******************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _mp4_remuxer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mp4-remuxer */ \"./src/remux/mp4-remuxer.ts\");\n/* harmony import */ var _utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/mp4-tools */ \"./src/utils/mp4-tools.ts\");\n/* harmony import */ var _loader_fragment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../loader/fragment */ \"./src/loader/fragment.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n\n\n\n\n\n\n\nvar PassThroughRemuxer = /*#__PURE__*/function () {\n function PassThroughRemuxer() {\n this.emitInitSegment = false;\n this.audioCodec = void 0;\n this.videoCodec = void 0;\n this.initData = void 0;\n this.initPTS = void 0;\n this.initTracks = void 0;\n this.lastEndTime = null;\n }\n var _proto = PassThroughRemuxer.prototype;\n _proto.destroy = function destroy() {};\n _proto.resetTimeStamp = function resetTimeStamp(defaultInitPTS) {\n this.initPTS = defaultInitPTS;\n this.lastEndTime = null;\n };\n _proto.resetNextTimestamp = function resetNextTimestamp() {\n this.lastEndTime = null;\n };\n _proto.resetInitSegment = function resetInitSegment(initSegment, audioCodec, videoCodec, decryptdata) {\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this.generateInitSegment((0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.patchEncyptionData)(initSegment, decryptdata));\n this.emitInitSegment = true;\n };\n _proto.generateInitSegment = function generateInitSegment(initSegment) {\n var audioCodec = this.audioCodec,\n videoCodec = this.videoCodec;\n if (!initSegment || !initSegment.byteLength) {\n this.initTracks = undefined;\n this.initData = undefined;\n return;\n }\n var initData = this.initData = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.parseInitSegment)(initSegment);\n\n // Get codec from initSegment or fallback to default\n if (!audioCodec) {\n audioCodec = getParsedTrackCodec(initData.audio, _loader_fragment__WEBPACK_IMPORTED_MODULE_3__.ElementaryStreamTypes.AUDIO);\n }\n if (!videoCodec) {\n videoCodec = getParsedTrackCodec(initData.video, _loader_fragment__WEBPACK_IMPORTED_MODULE_3__.ElementaryStreamTypes.VIDEO);\n }\n var tracks = {};\n if (initData.audio && initData.video) {\n tracks.audiovideo = {\n container: 'video/mp4',\n codec: audioCodec + ',' + videoCodec,\n initSegment: initSegment,\n id: 'main'\n };\n } else if (initData.audio) {\n tracks.audio = {\n container: 'audio/mp4',\n codec: audioCodec,\n initSegment: initSegment,\n id: 'audio'\n };\n } else if (initData.video) {\n tracks.video = {\n container: 'video/mp4',\n codec: videoCodec,\n initSegment: initSegment,\n id: 'main'\n };\n } else {\n _utils_logger__WEBPACK_IMPORTED_MODULE_4__.logger.warn('[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes.');\n }\n this.initTracks = tracks;\n };\n _proto.remux = function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset) {\n var _this$initPTS;\n var initPTS = this.initPTS,\n lastEndTime = this.lastEndTime;\n var result = {\n audio: undefined,\n video: undefined,\n text: textTrack,\n id3: id3Track,\n initSegment: undefined\n };\n\n // If we haven't yet set a lastEndDTS, or it was reset, set it to the provided timeOffset. We want to use the\n // lastEndDTS over timeOffset whenever possible; during progressive playback, the media source will not update\n // the media duration (which is what timeOffset is provided as) before we need to process the next chunk.\n if (!(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(lastEndTime)) {\n lastEndTime = this.lastEndTime = timeOffset || 0;\n }\n\n // The binary segment data is added to the videoTrack in the mp4demuxer. We don't check to see if the data is only\n // audio or video (or both); adding it to video was an arbitrary choice.\n var data = videoTrack.samples;\n if (!data || !data.length) {\n return result;\n }\n var initSegment = {\n initPTS: undefined,\n timescale: 1\n };\n var initData = this.initData;\n if (!initData || !initData.length) {\n this.generateInitSegment(data);\n initData = this.initData;\n }\n if (!initData || !initData.length) {\n // We can't remux if the initSegment could not be generated\n _utils_logger__WEBPACK_IMPORTED_MODULE_4__.logger.warn('[passthrough-remuxer.ts]: Failed to generate initSegment.');\n return result;\n }\n if (this.emitInitSegment) {\n initSegment.tracks = this.initTracks;\n this.emitInitSegment = false;\n }\n var startDTS = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.getStartDTS)(initData, data);\n if (!(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(initPTS)) {\n this.initPTS = initSegment.initPTS = initPTS = startDTS - timeOffset;\n }\n var duration = (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.getDuration)(data, initData);\n var startTime = audioTrack ? startDTS - initPTS : lastEndTime;\n var endTime = startTime + duration;\n (0,_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__.offsetStartDTS)(initData, data, initPTS);\n if (duration > 0) {\n this.lastEndTime = endTime;\n } else {\n _utils_logger__WEBPACK_IMPORTED_MODULE_4__.logger.warn('Duration parsed from mp4 should be greater than zero');\n this.resetNextTimestamp();\n }\n var hasAudio = !!initData.audio;\n var hasVideo = !!initData.video;\n var type = '';\n if (hasAudio) {\n type += 'audio';\n }\n if (hasVideo) {\n type += 'video';\n }\n var track = {\n data1: data,\n startPTS: startTime,\n startDTS: startTime,\n endPTS: endTime,\n endDTS: endTime,\n type: type,\n hasAudio: hasAudio,\n hasVideo: hasVideo,\n nb: 1,\n dropped: 0\n };\n result.audio = track.type === 'audio' ? track : undefined;\n result.video = track.type !== 'audio' ? track : undefined;\n result.initSegment = initSegment;\n var initPtsNum = (_this$initPTS = this.initPTS) != null ? _this$initPTS : 0;\n result.id3 = (0,_mp4_remuxer__WEBPACK_IMPORTED_MODULE_1__.flushTextTrackMetadataCueSamples)(id3Track, timeOffset, initPtsNum, initPtsNum);\n if (textTrack.samples.length) {\n result.text = (0,_mp4_remuxer__WEBPACK_IMPORTED_MODULE_1__.flushTextTrackUserdataCueSamples)(textTrack, timeOffset, initPtsNum);\n }\n return result;\n };\n return PassThroughRemuxer;\n}();\nfunction getParsedTrackCodec(track, type) {\n var parsedCodec = track === null || track === void 0 ? void 0 : track.codec;\n if (parsedCodec && parsedCodec.length > 4) {\n return parsedCodec;\n }\n // Since mp4-tools cannot parse full codec string (see 'TODO: Parse codec details'... in mp4-tools)\n // Provide defaults based on codec type\n // This allows for some playback of some fmp4 playlists without CODECS defined in manifest\n if (parsedCodec === 'hvc1' || parsedCodec === 'hev1') {\n return 'hvc1.1.c.L120.90';\n }\n if (parsedCodec === 'av01') {\n return 'av01.0.04M.08';\n }\n if (parsedCodec === 'avc1' || type === _loader_fragment__WEBPACK_IMPORTED_MODULE_3__.ElementaryStreamTypes.VIDEO) {\n return 'avc1.42e01e';\n }\n return 'mp4a.40.5';\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PassThroughRemuxer);\n\n/***/ }),\n\n/***/ \"./src/task-loop.ts\":\n/*!**************************!*\\\n !*** ./src/task-loop.ts ***!\n \\**************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ TaskLoop)\n/* harmony export */ });\n/**\n * Sub-class specialization of EventHandler base class.\n *\n * TaskLoop allows to schedule a task function being called (optionnaly repeatedly) on the main loop,\n * scheduled asynchroneously, avoiding recursive calls in the same tick.\n *\n * The task itself is implemented in `doTick`. It can be requested and called for single execution\n * using the `tick` method.\n *\n * It will be assured that the task execution method (`tick`) only gets called once per main loop \"tick\",\n * no matter how often it gets requested for execution. Execution in further ticks will be scheduled accordingly.\n *\n * If further execution requests have already been scheduled on the next tick, it can be checked with `hasNextTick`,\n * and cancelled with `clearNextTick`.\n *\n * The task can be scheduled as an interval repeatedly with a period as parameter (see `setInterval`, `clearInterval`).\n *\n * Sub-classes need to implement the `doTick` method which will effectively have the task execution routine.\n *\n * Further explanations:\n *\n * The baseclass has a `tick` method that will schedule the doTick call. It may be called synchroneously\n * only for a stack-depth of one. On re-entrant calls, sub-sequent calls are scheduled for next main loop ticks.\n *\n * When the task execution (`tick` method) is called in re-entrant way this is detected and\n * we are limiting the task execution per call stack to exactly one, but scheduling/post-poning further\n * task processing on the next main loop iteration (also known as \"next tick\" in the Node/JS runtime lingo).\n */\nvar TaskLoop = /*#__PURE__*/function () {\n function TaskLoop() {\n this._boundTick = void 0;\n this._tickTimer = null;\n this._tickInterval = null;\n this._tickCallCount = 0;\n this._boundTick = this.tick.bind(this);\n }\n var _proto = TaskLoop.prototype;\n _proto.destroy = function destroy() {\n this.onHandlerDestroying();\n this.onHandlerDestroyed();\n };\n _proto.onHandlerDestroying = function onHandlerDestroying() {\n // clear all timers before unregistering from event bus\n this.clearNextTick();\n this.clearInterval();\n };\n _proto.onHandlerDestroyed = function onHandlerDestroyed() {}\n\n /**\n * @returns {boolean}\n */;\n _proto.hasInterval = function hasInterval() {\n return !!this._tickInterval;\n }\n\n /**\n * @returns {boolean}\n */;\n _proto.hasNextTick = function hasNextTick() {\n return !!this._tickTimer;\n }\n\n /**\n * @param {number} millis Interval time (ms)\n * @returns {boolean} True when interval has been scheduled, false when already scheduled (no effect)\n */;\n _proto.setInterval = function setInterval(millis) {\n if (!this._tickInterval) {\n this._tickInterval = self.setInterval(this._boundTick, millis);\n return true;\n }\n return false;\n }\n\n /**\n * @returns {boolean} True when interval was cleared, false when none was set (no effect)\n */;\n _proto.clearInterval = function clearInterval() {\n if (this._tickInterval) {\n self.clearInterval(this._tickInterval);\n this._tickInterval = null;\n return true;\n }\n return false;\n }\n\n /**\n * @returns {boolean} True when timeout was cleared, false when none was set (no effect)\n */;\n _proto.clearNextTick = function clearNextTick() {\n if (this._tickTimer) {\n self.clearTimeout(this._tickTimer);\n this._tickTimer = null;\n return true;\n }\n return false;\n }\n\n /**\n * Will call the subclass doTick implementation in this main loop tick\n * or in the next one (via setTimeout(,0)) in case it has already been called\n * in this tick (in case this is a re-entrant call).\n */;\n _proto.tick = function tick() {\n this._tickCallCount++;\n if (this._tickCallCount === 1) {\n this.doTick();\n // re-entrant call to tick from previous doTick call stack\n // -> schedule a call on the next main loop iteration to process this task processing request\n if (this._tickCallCount > 1) {\n // make sure only one timer exists at any time at max\n this.tickImmediate();\n }\n this._tickCallCount = 0;\n }\n };\n _proto.tickImmediate = function tickImmediate() {\n this.clearNextTick();\n this._tickTimer = self.setTimeout(this._boundTick, 0);\n }\n\n /**\n * For subclass to implement task logic\n * @abstract\n */;\n _proto.doTick = function doTick() {};\n return TaskLoop;\n}();\n\n\n/***/ }),\n\n/***/ \"./src/types/demuxer.ts\":\n/*!******************************!*\\\n !*** ./src/types/demuxer.ts ***!\n \\******************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MetadataSchema\": () => (/* binding */ MetadataSchema)\n/* harmony export */ });\nvar MetadataSchema;\n(function (MetadataSchema) {\n MetadataSchema[\"audioId3\"] = \"org.id3\";\n MetadataSchema[\"dateRange\"] = \"com.apple.quicktime.HLS\";\n MetadataSchema[\"emsg\"] = \"https://aomedia.org/emsg/ID3\";\n})(MetadataSchema || (MetadataSchema = {}));\n\n/***/ }),\n\n/***/ \"./src/types/level.ts\":\n/*!****************************!*\\\n !*** ./src/types/level.ts ***!\n \\****************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HdcpLevels\": () => (/* binding */ HdcpLevels),\n/* harmony export */ \"HlsSkip\": () => (/* binding */ HlsSkip),\n/* harmony export */ \"HlsUrlParameters\": () => (/* binding */ HlsUrlParameters),\n/* harmony export */ \"Level\": () => (/* binding */ Level),\n/* harmony export */ \"getSkipValue\": () => (/* binding */ getSkipValue)\n/* harmony export */ });\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar HdcpLevels = ['NONE', 'TYPE-0', 'TYPE-1', 'TYPE-2', null];\nvar HlsSkip;\n(function (HlsSkip) {\n HlsSkip[\"No\"] = \"\";\n HlsSkip[\"Yes\"] = \"YES\";\n HlsSkip[\"v2\"] = \"v2\";\n})(HlsSkip || (HlsSkip = {}));\nfunction getSkipValue(details, msn) {\n var canSkipUntil = details.canSkipUntil,\n canSkipDateRanges = details.canSkipDateRanges,\n endSN = details.endSN;\n var snChangeGoal = msn !== undefined ? msn - endSN : 0;\n if (canSkipUntil && snChangeGoal < canSkipUntil) {\n if (canSkipDateRanges) {\n return HlsSkip.v2;\n }\n return HlsSkip.Yes;\n }\n return HlsSkip.No;\n}\nvar HlsUrlParameters = /*#__PURE__*/function () {\n function HlsUrlParameters(msn, part, skip) {\n this.msn = void 0;\n this.part = void 0;\n this.skip = void 0;\n this.msn = msn;\n this.part = part;\n this.skip = skip;\n }\n var _proto = HlsUrlParameters.prototype;\n _proto.addDirectives = function addDirectives(uri) {\n var url = new self.URL(uri);\n if (this.msn !== undefined) {\n url.searchParams.set('_HLS_msn', this.msn.toString());\n }\n if (this.part !== undefined) {\n url.searchParams.set('_HLS_part', this.part.toString());\n }\n if (this.skip) {\n url.searchParams.set('_HLS_skip', this.skip);\n }\n return url.href;\n };\n return HlsUrlParameters;\n}();\nvar Level = /*#__PURE__*/function () {\n function Level(data) {\n this.attrs = void 0;\n this.audioCodec = void 0;\n this.bitrate = void 0;\n this.codecSet = void 0;\n this.height = void 0;\n this.id = void 0;\n this.name = void 0;\n this.videoCodec = void 0;\n this.width = void 0;\n this.unknownCodecs = void 0;\n this.audioGroupIds = void 0;\n this.details = void 0;\n this.fragmentError = 0;\n this.loadError = 0;\n this.loaded = void 0;\n this.realBitrate = 0;\n this.textGroupIds = void 0;\n this.url = void 0;\n this._urlId = 0;\n this.url = [data.url];\n this.attrs = data.attrs;\n this.bitrate = data.bitrate;\n if (data.details) {\n this.details = data.details;\n }\n this.id = data.id || 0;\n this.name = data.name;\n this.width = data.width || 0;\n this.height = data.height || 0;\n this.audioCodec = data.audioCodec;\n this.videoCodec = data.videoCodec;\n this.unknownCodecs = data.unknownCodecs;\n this.codecSet = [data.videoCodec, data.audioCodec].filter(function (c) {\n return c;\n }).join(',').replace(/\\.[^.,]+/g, '');\n }\n _createClass(Level, [{\n key: \"maxBitrate\",\n get: function get() {\n return Math.max(this.realBitrate, this.bitrate);\n }\n }, {\n key: \"uri\",\n get: function get() {\n return this.url[this._urlId] || '';\n }\n }, {\n key: \"urlId\",\n get: function get() {\n return this._urlId;\n },\n set: function set(value) {\n var newValue = value % this.url.length;\n if (this._urlId !== newValue) {\n this.details = undefined;\n this._urlId = newValue;\n }\n }\n }]);\n return Level;\n}();\n\n/***/ }),\n\n/***/ \"./src/types/loader.ts\":\n/*!*****************************!*\\\n !*** ./src/types/loader.ts ***!\n \\*****************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PlaylistContextType\": () => (/* binding */ PlaylistContextType),\n/* harmony export */ \"PlaylistLevelType\": () => (/* binding */ PlaylistLevelType)\n/* harmony export */ });\nvar PlaylistContextType;\n(function (PlaylistContextType) {\n PlaylistContextType[\"MANIFEST\"] = \"manifest\";\n PlaylistContextType[\"LEVEL\"] = \"level\";\n PlaylistContextType[\"AUDIO_TRACK\"] = \"audioTrack\";\n PlaylistContextType[\"SUBTITLE_TRACK\"] = \"subtitleTrack\";\n})(PlaylistContextType || (PlaylistContextType = {}));\nvar PlaylistLevelType;\n(function (PlaylistLevelType) {\n PlaylistLevelType[\"MAIN\"] = \"main\";\n PlaylistLevelType[\"AUDIO\"] = \"audio\";\n PlaylistLevelType[\"SUBTITLE\"] = \"subtitle\";\n})(PlaylistLevelType || (PlaylistLevelType = {}));\n\n/***/ }),\n\n/***/ \"./src/types/transmuxer.ts\":\n/*!*********************************!*\\\n !*** ./src/types/transmuxer.ts ***!\n \\*********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ChunkMetadata\": () => (/* binding */ ChunkMetadata)\n/* harmony export */ });\nvar ChunkMetadata = function ChunkMetadata(level, sn, id, size, part, partial) {\n if (size === void 0) {\n size = 0;\n }\n if (part === void 0) {\n part = -1;\n }\n if (partial === void 0) {\n partial = false;\n }\n this.level = void 0;\n this.sn = void 0;\n this.part = void 0;\n this.id = void 0;\n this.size = void 0;\n this.partial = void 0;\n this.transmuxing = getNewPerformanceTiming();\n this.buffering = {\n audio: getNewPerformanceTiming(),\n video: getNewPerformanceTiming(),\n audiovideo: getNewPerformanceTiming()\n };\n this.level = level;\n this.sn = sn;\n this.id = id;\n this.size = size;\n this.part = part;\n this.partial = partial;\n};\nfunction getNewPerformanceTiming() {\n return {\n start: 0,\n executeStart: 0,\n executeEnd: 0,\n end: 0\n };\n}\n\n/***/ }),\n\n/***/ \"./src/utils/attr-list.ts\":\n/*!********************************!*\\\n !*** ./src/utils/attr-list.ts ***!\n \\********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AttrList\": () => (/* binding */ AttrList)\n/* harmony export */ });\nvar DECIMAL_RESOLUTION_REGEX = /^(\\d+)x(\\d+)$/; // eslint-disable-line no-useless-escape\nvar ATTR_LIST_REGEX = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g; // eslint-disable-line no-useless-escape\n\n// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js\nvar AttrList = /*#__PURE__*/function () {\n function AttrList(attrs) {\n if (typeof attrs === 'string') {\n attrs = AttrList.parseAttrList(attrs);\n }\n for (var attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n this[attr] = attrs[attr];\n }\n }\n }\n var _proto = AttrList.prototype;\n _proto.decimalInteger = function decimalInteger(attrName) {\n var intValue = parseInt(this[attrName], 10);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n };\n _proto.hexadecimalInteger = function hexadecimalInteger(attrName) {\n if (this[attrName]) {\n var stringValue = (this[attrName] || '0x').slice(2);\n stringValue = (stringValue.length & 1 ? '0' : '') + stringValue;\n var value = new Uint8Array(stringValue.length / 2);\n for (var i = 0; i < stringValue.length / 2; i++) {\n value[i] = parseInt(stringValue.slice(i * 2, i * 2 + 2), 16);\n }\n return value;\n } else {\n return null;\n }\n };\n _proto.hexadecimalIntegerAsNumber = function hexadecimalIntegerAsNumber(attrName) {\n var intValue = parseInt(this[attrName], 16);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n };\n _proto.decimalFloatingPoint = function decimalFloatingPoint(attrName) {\n return parseFloat(this[attrName]);\n };\n _proto.optionalFloat = function optionalFloat(attrName, defaultValue) {\n var value = this[attrName];\n return value ? parseFloat(value) : defaultValue;\n };\n _proto.enumeratedString = function enumeratedString(attrName) {\n return this[attrName];\n };\n _proto.bool = function bool(attrName) {\n return this[attrName] === 'YES';\n };\n _proto.decimalResolution = function decimalResolution(attrName) {\n var res = DECIMAL_RESOLUTION_REGEX.exec(this[attrName]);\n if (res === null) {\n return undefined;\n }\n return {\n width: parseInt(res[1], 10),\n height: parseInt(res[2], 10)\n };\n };\n AttrList.parseAttrList = function parseAttrList(input) {\n var match;\n var attrs = {};\n var quote = '\"';\n ATTR_LIST_REGEX.lastIndex = 0;\n while ((match = ATTR_LIST_REGEX.exec(input)) !== null) {\n var value = match[2];\n if (value.indexOf(quote) === 0 && value.lastIndexOf(quote) === value.length - 1) {\n value = value.slice(1, -1);\n }\n attrs[match[1]] = value;\n }\n return attrs;\n };\n return AttrList;\n}();\n\n/***/ }),\n\n/***/ \"./src/utils/binary-search.ts\":\n/*!************************************!*\\\n !*** ./src/utils/binary-search.ts ***!\n \\************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nvar BinarySearch = {\n /**\n * Searches for an item in an array which matches a certain condition.\n * This requires the condition to only match one item in the array,\n * and for the array to be ordered.\n *\n * @param {Array<T>} list The array to search.\n * @param {BinarySearchComparison<T>} comparisonFn\n * Called and provided a candidate item as the first argument.\n * Should return:\n * > -1 if the item should be located at a lower index than the provided item.\n * > 1 if the item should be located at a higher index than the provided item.\n * > 0 if the item is the item you're looking for.\n *\n * @return {T | null} The object if it is found or null otherwise.\n */\n search: function search(list, comparisonFn) {\n var minIndex = 0;\n var maxIndex = list.length - 1;\n var currentIndex = null;\n var currentElement = null;\n while (minIndex <= maxIndex) {\n currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = list[currentIndex];\n var comparisonResult = comparisonFn(currentElement);\n if (comparisonResult > 0) {\n minIndex = currentIndex + 1;\n } else if (comparisonResult < 0) {\n maxIndex = currentIndex - 1;\n } else {\n return currentElement;\n }\n }\n return null;\n }\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BinarySearch);\n\n/***/ }),\n\n/***/ \"./src/utils/buffer-helper.ts\":\n/*!************************************!*\\\n !*** ./src/utils/buffer-helper.ts ***!\n \\************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BufferHelper\": () => (/* binding */ BufferHelper)\n/* harmony export */ });\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./logger */ \"./src/utils/logger.ts\");\n/**\n * @module BufferHelper\n *\n * Providing methods dealing with buffer length retrieval for example.\n *\n * In general, a helper around HTML5 MediaElement TimeRanges gathered from `buffered` property.\n *\n * Also @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/buffered\n */\n\n\nvar noopBuffered = {\n length: 0,\n start: function start() {\n return 0;\n },\n end: function end() {\n return 0;\n }\n};\nvar BufferHelper = /*#__PURE__*/function () {\n function BufferHelper() {}\n /**\n * Return true if `media`'s buffered include `position`\n * @param {Bufferable} media\n * @param {number} position\n * @returns {boolean}\n */\n BufferHelper.isBuffered = function isBuffered(media, position) {\n try {\n if (media) {\n var buffered = BufferHelper.getBuffered(media);\n for (var i = 0; i < buffered.length; i++) {\n if (position >= buffered.start(i) && position <= buffered.end(i)) {\n return true;\n }\n }\n }\n } catch (error) {\n // this is to catch\n // InvalidStateError: Failed to read the 'buffered' property from 'SourceBuffer':\n // This SourceBuffer has been removed from the parent media source\n }\n return false;\n };\n BufferHelper.bufferInfo = function bufferInfo(media, pos, maxHoleDuration) {\n try {\n if (media) {\n var vbuffered = BufferHelper.getBuffered(media);\n var buffered = [];\n var i;\n for (i = 0; i < vbuffered.length; i++) {\n buffered.push({\n start: vbuffered.start(i),\n end: vbuffered.end(i)\n });\n }\n return this.bufferedInfo(buffered, pos, maxHoleDuration);\n }\n } catch (error) {\n // this is to catch\n // InvalidStateError: Failed to read the 'buffered' property from 'SourceBuffer':\n // This SourceBuffer has been removed from the parent media source\n }\n return {\n len: 0,\n start: pos,\n end: pos,\n nextStart: undefined\n };\n };\n BufferHelper.bufferedInfo = function bufferedInfo(buffered, pos, maxHoleDuration) {\n pos = Math.max(0, pos);\n // sort on buffer.start/smaller end (IE does not always return sorted buffered range)\n buffered.sort(function (a, b) {\n var diff = a.start - b.start;\n if (diff) {\n return diff;\n } else {\n return b.end - a.end;\n }\n });\n var buffered2 = [];\n if (maxHoleDuration) {\n // there might be some small holes between buffer time range\n // consider that holes smaller than maxHoleDuration are irrelevant and build another\n // buffer time range representations that discards those holes\n for (var i = 0; i < buffered.length; i++) {\n var buf2len = buffered2.length;\n if (buf2len) {\n var buf2end = buffered2[buf2len - 1].end;\n // if small hole (value between 0 or maxHoleDuration ) or overlapping (negative)\n if (buffered[i].start - buf2end < maxHoleDuration) {\n // merge overlapping time ranges\n // update lastRange.end only if smaller than item.end\n // e.g. [ 1, 15] with [ 2,8] => [ 1,15] (no need to modify lastRange.end)\n // whereas [ 1, 8] with [ 2,15] => [ 1,15] ( lastRange should switch from [1,8] to [1,15])\n if (buffered[i].end > buf2end) {\n buffered2[buf2len - 1].end = buffered[i].end;\n }\n } else {\n // big hole\n buffered2.push(buffered[i]);\n }\n } else {\n // first value\n buffered2.push(buffered[i]);\n }\n }\n } else {\n buffered2 = buffered;\n }\n var bufferLen = 0;\n\n // bufferStartNext can possibly be undefined based on the conditional logic below\n var bufferStartNext;\n\n // bufferStart and bufferEnd are buffer boundaries around current video position\n var bufferStart = pos;\n var bufferEnd = pos;\n for (var _i = 0; _i < buffered2.length; _i++) {\n var start = buffered2[_i].start;\n var end = buffered2[_i].end;\n // logger.log('buf start/end:' + buffered.start(i) + '/' + buffered.end(i));\n if (pos + maxHoleDuration >= start && pos < end) {\n // play position is inside this buffer TimeRange, retrieve end of buffer position and buffer length\n bufferStart = start;\n bufferEnd = end;\n bufferLen = bufferEnd - pos;\n } else if (pos + maxHoleDuration < start) {\n bufferStartNext = start;\n break;\n }\n }\n return {\n len: bufferLen,\n start: bufferStart || 0,\n end: bufferEnd || 0,\n nextStart: bufferStartNext\n };\n }\n\n /**\n * Safe method to get buffered property.\n * SourceBuffer.buffered may throw if SourceBuffer is removed from it's MediaSource\n */;\n BufferHelper.getBuffered = function getBuffered(media) {\n try {\n return media.buffered;\n } catch (e) {\n _logger__WEBPACK_IMPORTED_MODULE_0__.logger.log('failed to get media.buffered', e);\n return noopBuffered;\n }\n };\n return BufferHelper;\n}();\n\n/***/ }),\n\n/***/ \"./src/utils/codecs.ts\":\n/*!*****************************!*\\\n !*** ./src/utils/codecs.ts ***!\n \\*****************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"isCodecSupportedInMp4\": () => (/* binding */ isCodecSupportedInMp4),\n/* harmony export */ \"isCodecType\": () => (/* binding */ isCodecType)\n/* harmony export */ });\n// from http://mp4ra.org/codecs.html\nvar sampleEntryCodesISO = {\n audio: {\n a3ds: true,\n 'ac-3': true,\n 'ac-4': true,\n alac: true,\n alaw: true,\n dra1: true,\n 'dts+': true,\n 'dts-': true,\n dtsc: true,\n dtse: true,\n dtsh: true,\n 'ec-3': true,\n enca: true,\n g719: true,\n g726: true,\n m4ae: true,\n mha1: true,\n mha2: true,\n mhm1: true,\n mhm2: true,\n mlpa: true,\n mp4a: true,\n 'raw ': true,\n Opus: true,\n opus: true,\n // browsers expect this to be lowercase despite MP4RA says 'Opus'\n samr: true,\n sawb: true,\n sawp: true,\n sevc: true,\n sqcp: true,\n ssmv: true,\n twos: true,\n ulaw: true\n },\n video: {\n avc1: true,\n avc2: true,\n avc3: true,\n avc4: true,\n avcp: true,\n av01: true,\n drac: true,\n dva1: true,\n dvav: true,\n dvh1: true,\n dvhe: true,\n encv: true,\n hev1: true,\n hvc1: true,\n mjp2: true,\n mp4v: true,\n mvc1: true,\n mvc2: true,\n mvc3: true,\n mvc4: true,\n resv: true,\n rv60: true,\n s263: true,\n svc1: true,\n svc2: true,\n 'vc-1': true,\n vp08: true,\n vp09: true\n },\n text: {\n stpp: true,\n wvtt: true\n }\n};\nfunction isCodecType(codec, type) {\n var typeCodes = sampleEntryCodesISO[type];\n return !!typeCodes && typeCodes[codec.slice(0, 4)] === true;\n}\nfunction isCodecSupportedInMp4(codec, type) {\n return MediaSource.isTypeSupported((type || 'video') + \"/mp4;codecs=\\\"\" + codec + \"\\\"\");\n}\n\n/***/ }),\n\n/***/ \"./src/utils/discontinuities.ts\":\n/*!**************************************!*\\\n !*** ./src/utils/discontinuities.ts ***!\n \\**************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"adjustSlidingStart\": () => (/* binding */ adjustSlidingStart),\n/* harmony export */ \"alignMediaPlaylistByPDT\": () => (/* binding */ alignMediaPlaylistByPDT),\n/* harmony export */ \"alignPDT\": () => (/* binding */ alignPDT),\n/* harmony export */ \"alignStream\": () => (/* binding */ alignStream),\n/* harmony export */ \"findDiscontinuousReferenceFrag\": () => (/* binding */ findDiscontinuousReferenceFrag),\n/* harmony export */ \"findFirstFragWithCC\": () => (/* binding */ findFirstFragWithCC),\n/* harmony export */ \"shouldAlignOnDiscontinuities\": () => (/* binding */ shouldAlignOnDiscontinuities)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _controller_level_helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../controller/level-helper */ \"./src/controller/level-helper.ts\");\n\n\n\n\nfunction findFirstFragWithCC(fragments, cc) {\n var firstFrag = null;\n for (var i = 0, len = fragments.length; i < len; i++) {\n var currentFrag = fragments[i];\n if (currentFrag && currentFrag.cc === cc) {\n firstFrag = currentFrag;\n break;\n }\n }\n return firstFrag;\n}\nfunction shouldAlignOnDiscontinuities(lastFrag, lastLevel, details) {\n if (lastLevel.details) {\n if (details.endCC > details.startCC || lastFrag && lastFrag.cc < details.startCC) {\n return true;\n }\n }\n return false;\n}\n\n// Find the first frag in the previous level which matches the CC of the first frag of the new level\nfunction findDiscontinuousReferenceFrag(prevDetails, curDetails, referenceIndex) {\n if (referenceIndex === void 0) {\n referenceIndex = 0;\n }\n var prevFrags = prevDetails.fragments;\n var curFrags = curDetails.fragments;\n if (!curFrags.length || !prevFrags.length) {\n _logger__WEBPACK_IMPORTED_MODULE_1__.logger.log('No fragments to align');\n return;\n }\n var prevStartFrag = findFirstFragWithCC(prevFrags, curFrags[0].cc);\n if (!prevStartFrag || prevStartFrag && !prevStartFrag.startPTS) {\n _logger__WEBPACK_IMPORTED_MODULE_1__.logger.log('No frag in previous level to align on');\n return;\n }\n return prevStartFrag;\n}\nfunction adjustFragmentStart(frag, sliding) {\n if (frag) {\n var start = frag.start + sliding;\n frag.start = frag.startPTS = start;\n frag.endPTS = start + frag.duration;\n }\n}\nfunction adjustSlidingStart(sliding, details) {\n // Update segments\n var fragments = details.fragments;\n for (var i = 0, len = fragments.length; i < len; i++) {\n adjustFragmentStart(fragments[i], sliding);\n }\n // Update LL-HLS parts at the end of the playlist\n if (details.fragmentHint) {\n adjustFragmentStart(details.fragmentHint, sliding);\n }\n details.alignedSliding = true;\n}\n\n/**\n * Using the parameters of the last level, this function computes PTS' of the new fragments so that they form a\n * contiguous stream with the last fragments.\n * The PTS of a fragment lets Hls.js know where it fits into a stream - by knowing every PTS, we know which fragment to\n * download at any given time. PTS is normally computed when the fragment is demuxed, so taking this step saves us time\n * and an extra download.\n * @param lastFrag\n * @param lastLevel\n * @param details\n */\nfunction alignStream(lastFrag, lastLevel, details) {\n if (!lastLevel) {\n return;\n }\n alignDiscontinuities(lastFrag, details, lastLevel);\n if (!details.alignedSliding && lastLevel.details) {\n // If the PTS wasn't figured out via discontinuity sequence that means there was no CC increase within the level.\n // Aligning via Program Date Time should therefore be reliable, since PDT should be the same within the same\n // discontinuity sequence.\n alignPDT(details, lastLevel.details);\n }\n if (!details.alignedSliding && lastLevel.details && !details.skippedSegments) {\n // Try to align on sn so that we pick a better start fragment.\n // Do not perform this on playlists with delta updates as this is only to align levels on switch\n // and adjustSliding only adjusts fragments after skippedSegments.\n (0,_controller_level_helper__WEBPACK_IMPORTED_MODULE_2__.adjustSliding)(lastLevel.details, details);\n }\n}\n\n/**\n * Computes the PTS if a new level's fragments using the PTS of a fragment in the last level which shares the same\n * discontinuity sequence.\n * @param lastFrag - The last Fragment which shares the same discontinuity sequence\n * @param lastLevel - The details of the last loaded level\n * @param details - The details of the new level\n */\nfunction alignDiscontinuities(lastFrag, details, lastLevel) {\n if (shouldAlignOnDiscontinuities(lastFrag, lastLevel, details)) {\n var referenceFrag = findDiscontinuousReferenceFrag(lastLevel.details, details);\n if (referenceFrag && (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(referenceFrag.start)) {\n _logger__WEBPACK_IMPORTED_MODULE_1__.logger.log(\"Adjusting PTS using last level due to CC increase within current level \" + details.url);\n adjustSlidingStart(referenceFrag.start, details);\n }\n }\n}\n\n/**\n * Computes the PTS of a new level's fragments using the difference in Program Date Time from the last level.\n * @param details - The details of the new level\n * @param lastDetails - The details of the last loaded level\n */\nfunction alignPDT(details, lastDetails) {\n // This check protects the unsafe \"!\" usage below for null program date time access.\n if (!lastDetails.fragments.length || !details.hasProgramDateTime || !lastDetails.hasProgramDateTime) {\n return;\n }\n // if last level sliding is 1000 and its first frag PROGRAM-DATE-TIME is 2017-08-20 1:10:00 AM\n // and if new details first frag PROGRAM DATE-TIME is 2017-08-20 1:10:08 AM\n // then we can deduce that playlist B sliding is 1000+8 = 1008s\n var lastPDT = lastDetails.fragments[0].programDateTime; // hasProgramDateTime check above makes this safe.\n var newPDT = details.fragments[0].programDateTime;\n // date diff is in ms. frag.start is in seconds\n var sliding = (newPDT - lastPDT) / 1000 + lastDetails.fragments[0].start;\n if (sliding && (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(sliding)) {\n _logger__WEBPACK_IMPORTED_MODULE_1__.logger.log(\"Adjusting PTS using programDateTime delta \" + (newPDT - lastPDT) + \"ms, sliding:\" + sliding.toFixed(3) + \" \" + details.url + \" \");\n adjustSlidingStart(sliding, details);\n }\n}\n\n/**\n * Ensures appropriate time-alignment between renditions based on PDT. Unlike `alignPDT`, which adjusts\n * the timeline based on the delta between PDTs of the 0th fragment of two playlists/`LevelDetails`,\n * this function assumes the timelines represented in `refDetails` are accurate, including the PDTs,\n * and uses the \"wallclock\"/PDT timeline as a cross-reference to `details`, adjusting the presentation\n * times/timelines of `details` accordingly.\n * Given the asynchronous nature of fetches and initial loads of live `main` and audio/subtitle tracks,\n * the primary purpose of this function is to ensure the \"local timelines\" of audio/subtitle tracks\n * are aligned to the main/video timeline, using PDT as the cross-reference/\"anchor\" that should\n * be consistent across playlists, per the HLS spec.\n * @param details - The details of the rendition you'd like to time-align (e.g. an audio rendition).\n * @param refDetails - The details of the reference rendition with start and PDT times for alignment.\n */\nfunction alignMediaPlaylistByPDT(details, refDetails) {\n if (!details.hasProgramDateTime || !refDetails.hasProgramDateTime) {\n return;\n }\n var fragments = details.fragments;\n var refFragments = refDetails.fragments;\n if (!fragments.length || !refFragments.length) {\n return;\n }\n\n // Calculate a delta to apply to all fragments according to the delta in PDT times and start times\n // of a fragment in the reference details, and a fragment in the target details of the same discontinuity.\n // If a fragment of the same discontinuity was not found use the middle fragment of both.\n var middleFrag = Math.round(refFragments.length / 2) - 1;\n var refFrag = refFragments[middleFrag];\n var frag = findFirstFragWithCC(fragments, refFrag.cc) || fragments[Math.round(fragments.length / 2) - 1];\n var refPDT = refFrag.programDateTime;\n var targetPDT = frag.programDateTime;\n if (refPDT === null || targetPDT === null) {\n return;\n }\n var delta = (targetPDT - refPDT) / 1000 - (frag.start - refFrag.start);\n adjustSlidingStart(delta, details);\n}\n\n/***/ }),\n\n/***/ \"./src/utils/ewma-bandwidth-estimator.ts\":\n/*!***********************************************!*\\\n !*** ./src/utils/ewma-bandwidth-estimator.ts ***!\n \\***********************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_ewma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/ewma */ \"./src/utils/ewma.ts\");\n/*\n * EWMA Bandwidth Estimator\n * - heavily inspired from shaka-player\n * Tracks bandwidth samples and estimates available bandwidth.\n * Based on the minimum of two exponentially-weighted moving averages with\n * different half-lives.\n */\n\n\nvar EwmaBandWidthEstimator = /*#__PURE__*/function () {\n function EwmaBandWidthEstimator(slow, fast, defaultEstimate) {\n this.defaultEstimate_ = void 0;\n this.minWeight_ = void 0;\n this.minDelayMs_ = void 0;\n this.slow_ = void 0;\n this.fast_ = void 0;\n this.defaultEstimate_ = defaultEstimate;\n this.minWeight_ = 0.001;\n this.minDelayMs_ = 50;\n this.slow_ = new _utils_ewma__WEBPACK_IMPORTED_MODULE_0__[\"default\"](slow);\n this.fast_ = new _utils_ewma__WEBPACK_IMPORTED_MODULE_0__[\"default\"](fast);\n }\n var _proto = EwmaBandWidthEstimator.prototype;\n _proto.update = function update(slow, fast) {\n var slow_ = this.slow_,\n fast_ = this.fast_;\n if (this.slow_.halfLife !== slow) {\n this.slow_ = new _utils_ewma__WEBPACK_IMPORTED_MODULE_0__[\"default\"](slow, slow_.getEstimate(), slow_.getTotalWeight());\n }\n if (this.fast_.halfLife !== fast) {\n this.fast_ = new _utils_ewma__WEBPACK_IMPORTED_MODULE_0__[\"default\"](fast, fast_.getEstimate(), fast_.getTotalWeight());\n }\n };\n _proto.sample = function sample(durationMs, numBytes) {\n durationMs = Math.max(durationMs, this.minDelayMs_);\n var numBits = 8 * numBytes;\n // weight is duration in seconds\n var durationS = durationMs / 1000;\n // value is bandwidth in bits/s\n var bandwidthInBps = numBits / durationS;\n this.fast_.sample(durationS, bandwidthInBps);\n this.slow_.sample(durationS, bandwidthInBps);\n };\n _proto.canEstimate = function canEstimate() {\n var fast = this.fast_;\n return fast && fast.getTotalWeight() >= this.minWeight_;\n };\n _proto.getEstimate = function getEstimate() {\n if (this.canEstimate()) {\n // console.log('slow estimate:'+ Math.round(this.slow_.getEstimate()));\n // console.log('fast estimate:'+ Math.round(this.fast_.getEstimate()));\n // Take the minimum of these two estimates. This should have the effect of\n // adapting down quickly, but up more slowly.\n return Math.min(this.fast_.getEstimate(), this.slow_.getEstimate());\n } else {\n return this.defaultEstimate_;\n }\n };\n _proto.destroy = function destroy() {};\n return EwmaBandWidthEstimator;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EwmaBandWidthEstimator);\n\n/***/ }),\n\n/***/ \"./src/utils/ewma.ts\":\n/*!***************************!*\\\n !*** ./src/utils/ewma.ts ***!\n \\***************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n * compute an Exponential Weighted moving average\n * - https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average\n * - heavily inspired from shaka-player\n */\nvar EWMA = /*#__PURE__*/function () {\n // About half of the estimated value will be from the last |halfLife| samples by weight.\n function EWMA(halfLife, estimate, weight) {\n if (estimate === void 0) {\n estimate = 0;\n }\n if (weight === void 0) {\n weight = 0;\n }\n this.halfLife = void 0;\n this.alpha_ = void 0;\n this.estimate_ = void 0;\n this.totalWeight_ = void 0;\n this.halfLife = halfLife;\n // Larger values of alpha expire historical data more slowly.\n this.alpha_ = halfLife ? Math.exp(Math.log(0.5) / halfLife) : 0;\n this.estimate_ = estimate;\n this.totalWeight_ = weight;\n }\n var _proto = EWMA.prototype;\n _proto.sample = function sample(weight, value) {\n var adjAlpha = Math.pow(this.alpha_, weight);\n this.estimate_ = value * (1 - adjAlpha) + adjAlpha * this.estimate_;\n this.totalWeight_ += weight;\n };\n _proto.getTotalWeight = function getTotalWeight() {\n return this.totalWeight_;\n };\n _proto.getEstimate = function getEstimate() {\n if (this.alpha_) {\n var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);\n if (zeroFactor) {\n return this.estimate_ / zeroFactor;\n }\n }\n return this.estimate_;\n };\n return EWMA;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EWMA);\n\n/***/ }),\n\n/***/ \"./src/utils/fetch-loader.ts\":\n/*!***********************************!*\\\n !*** ./src/utils/fetch-loader.ts ***!\n \\***********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ \"fetchSupported\": () => (/* binding */ fetchSupported)\n/* harmony export */ });\n/* harmony import */ var _home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/polyfills/number */ \"./src/polyfills/number.ts\");\n/* harmony import */ var _loader_load_stats__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../loader/load-stats */ \"./src/loader/load-stats.ts\");\n/* harmony import */ var _demux_chunk_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../demux/chunk-cache */ \"./src/demux/chunk-cache.ts\");\n\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\n\nfunction fetchSupported() {\n if (\n // @ts-ignore\n self.fetch && self.AbortController && self.ReadableStream && self.Request) {\n try {\n new self.ReadableStream({}); // eslint-disable-line no-new\n return true;\n } catch (e) {\n /* noop */\n }\n }\n return false;\n}\nvar FetchLoader = /*#__PURE__*/function () {\n function FetchLoader(config /* HlsConfig */) {\n this.fetchSetup = void 0;\n this.requestTimeout = void 0;\n this.request = void 0;\n this.response = void 0;\n this.controller = void 0;\n this.context = void 0;\n this.config = null;\n this.callbacks = null;\n this.stats = void 0;\n this.loader = null;\n this.fetchSetup = config.fetchSetup || getRequest;\n this.controller = new self.AbortController();\n this.stats = new _loader_load_stats__WEBPACK_IMPORTED_MODULE_1__.LoadStats();\n }\n var _proto = FetchLoader.prototype;\n _proto.destroy = function destroy() {\n this.loader = this.callbacks = null;\n this.abortInternal();\n };\n _proto.abortInternal = function abortInternal() {\n var response = this.response;\n if (!response || !response.ok) {\n this.stats.aborted = true;\n this.controller.abort();\n }\n };\n _proto.abort = function abort() {\n var _this$callbacks;\n this.abortInternal();\n if ((_this$callbacks = this.callbacks) !== null && _this$callbacks !== void 0 && _this$callbacks.onAbort) {\n this.callbacks.onAbort(this.stats, this.context, this.response);\n }\n };\n _proto.load = function load(context, config, callbacks) {\n var _this = this;\n var stats = this.stats;\n if (stats.loading.start) {\n throw new Error('Loader can only be used once.');\n }\n stats.loading.start = self.performance.now();\n var initParams = getRequestParameters(context, this.controller.signal);\n var onProgress = callbacks.onProgress;\n var isArrayBuffer = context.responseType === 'arraybuffer';\n var LENGTH = isArrayBuffer ? 'byteLength' : 'length';\n this.context = context;\n this.config = config;\n this.callbacks = callbacks;\n this.request = this.fetchSetup(context, initParams);\n self.clearTimeout(this.requestTimeout);\n this.requestTimeout = self.setTimeout(function () {\n _this.abortInternal();\n callbacks.onTimeout(stats, context, _this.response);\n }, config.timeout);\n self.fetch(this.request).then(function (response) {\n _this.response = _this.loader = response;\n if (!response.ok) {\n var status = response.status,\n statusText = response.statusText;\n throw new FetchError(statusText || 'fetch, bad network response', status, response);\n }\n stats.loading.first = Math.max(self.performance.now(), stats.loading.start);\n stats.total = parseInt(response.headers.get('Content-Length') || '0');\n if (onProgress && (0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(config.highWaterMark)) {\n return _this.loadProgressively(response, stats, context, config.highWaterMark, onProgress);\n }\n if (isArrayBuffer) {\n return response.arrayBuffer();\n }\n return response.text();\n }).then(function (responseData) {\n var response = _this.response;\n self.clearTimeout(_this.requestTimeout);\n stats.loading.end = Math.max(self.performance.now(), stats.loading.first);\n var total = responseData[LENGTH];\n if (total) {\n stats.loaded = stats.total = total;\n }\n var loaderResponse = {\n url: response.url,\n data: responseData\n };\n if (onProgress && !(0,_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__.isFiniteNumber)(config.highWaterMark)) {\n onProgress(stats, context, responseData, response);\n }\n callbacks.onSuccess(loaderResponse, stats, context, response);\n }).catch(function (error) {\n self.clearTimeout(_this.requestTimeout);\n if (stats.aborted) {\n return;\n }\n // CORS errors result in an undefined code. Set it to 0 here to align with XHR's behavior\n // when destroying, 'error' itself can be undefined\n var code = !error ? 0 : error.code || 0;\n var text = !error ? null : error.message;\n callbacks.onError({\n code: code,\n text: text\n }, context, error ? error.details : null);\n });\n };\n _proto.getCacheAge = function getCacheAge() {\n var result = null;\n if (this.response) {\n var ageHeader = this.response.headers.get('age');\n result = ageHeader ? parseFloat(ageHeader) : null;\n }\n return result;\n };\n _proto.loadProgressively = function loadProgressively(response, stats, context, highWaterMark, onProgress) {\n if (highWaterMark === void 0) {\n highWaterMark = 0;\n }\n var chunkCache = new _demux_chunk_cache__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n var reader = response.body.getReader();\n var pump = function pump() {\n return reader.read().then(function (data) {\n if (data.done) {\n if (chunkCache.dataLength) {\n onProgress(stats, context, chunkCache.flush(), response);\n }\n return Promise.resolve(new ArrayBuffer(0));\n }\n var chunk = data.value;\n var len = chunk.length;\n stats.loaded += len;\n if (len < highWaterMark || chunkCache.dataLength) {\n // The current chunk is too small to to be emitted or the cache already has data\n // Push it to the cache\n chunkCache.push(chunk);\n if (chunkCache.dataLength >= highWaterMark) {\n // flush in order to join the typed arrays\n onProgress(stats, context, chunkCache.flush(), response);\n }\n } else {\n // If there's nothing cached already, and the chache is large enough\n // just emit the progress event\n onProgress(stats, context, chunk, response);\n }\n return pump();\n }).catch(function () {\n /* aborted */\n return Promise.reject();\n });\n };\n return pump();\n };\n return FetchLoader;\n}();\nfunction getRequestParameters(context, signal) {\n var initParams = {\n method: 'GET',\n mode: 'cors',\n credentials: 'same-origin',\n signal: signal,\n headers: new self.Headers(_extends({}, context.headers))\n };\n if (context.rangeEnd) {\n initParams.headers.set('Range', 'bytes=' + context.rangeStart + '-' + String(context.rangeEnd - 1));\n }\n return initParams;\n}\nfunction getRequest(context, initParams) {\n return new self.Request(context.url, initParams);\n}\nvar FetchError = /*#__PURE__*/function (_Error) {\n _inheritsLoose(FetchError, _Error);\n function FetchError(message, code, details) {\n var _this2;\n _this2 = _Error.call(this, message) || this;\n _this2.code = void 0;\n _this2.details = void 0;\n _this2.code = code;\n _this2.details = details;\n return _this2;\n }\n return FetchError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FetchLoader);\n\n/***/ }),\n\n/***/ \"./src/utils/hex.ts\":\n/*!**************************!*\\\n !*** ./src/utils/hex.ts ***!\n \\**************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * hex dump helper class\n */\n\nvar Hex = {\n hexDump: function hexDump(array) {\n var str = '';\n for (var i = 0; i < array.length; i++) {\n var h = array[i].toString(16);\n if (h.length < 2) {\n h = '0' + h;\n }\n str += h;\n }\n return str;\n }\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Hex);\n\n/***/ }),\n\n/***/ \"./src/utils/keysystem-util.ts\":\n/*!*************************************!*\\\n !*** ./src/utils/keysystem-util.ts ***!\n \\*************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"changeEndianness\": () => (/* binding */ changeEndianness),\n/* harmony export */ \"convertDataUriToArrayBytes\": () => (/* binding */ convertDataUriToArrayBytes),\n/* harmony export */ \"strToUtf8array\": () => (/* binding */ strToUtf8array)\n/* harmony export */ });\n/* harmony import */ var _numeric_encoding_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./numeric-encoding-utils */ \"./src/utils/numeric-encoding-utils.ts\");\n\nfunction getKeyIdBytes(str) {\n var keyIdbytes = strToUtf8array(str).subarray(0, 16);\n var paddedkeyIdbytes = new Uint8Array(16);\n paddedkeyIdbytes.set(keyIdbytes, 16 - keyIdbytes.length);\n return paddedkeyIdbytes;\n}\nfunction changeEndianness(keyId) {\n var swap = function swap(array, from, to) {\n var cur = array[from];\n array[from] = array[to];\n array[to] = cur;\n };\n swap(keyId, 0, 3);\n swap(keyId, 1, 2);\n swap(keyId, 4, 5);\n swap(keyId, 6, 7);\n}\nfunction convertDataUriToArrayBytes(uri) {\n // data:[<media type][;attribute=value][;base64],<data>\n var colonsplit = uri.split(':');\n var keydata = null;\n if (colonsplit[0] === 'data' && colonsplit.length === 2) {\n var semicolonsplit = colonsplit[1].split(';');\n var commasplit = semicolonsplit[semicolonsplit.length - 1].split(',');\n if (commasplit.length === 2) {\n var isbase64 = commasplit[0] === 'base64';\n var data = commasplit[1];\n if (isbase64) {\n semicolonsplit.splice(-1, 1); // remove from processing\n keydata = (0,_numeric_encoding_utils__WEBPACK_IMPORTED_MODULE_0__.base64Decode)(data);\n } else {\n keydata = getKeyIdBytes(data);\n }\n }\n }\n return keydata;\n}\nfunction strToUtf8array(str) {\n return Uint8Array.from(unescape(encodeURIComponent(str)), function (c) {\n return c.charCodeAt(0);\n });\n}\n\n/***/ }),\n\n/***/ \"./src/utils/logger.ts\":\n/*!*****************************!*\\\n !*** ./src/utils/logger.ts ***!\n \\*****************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"enableLogs\": () => (/* binding */ enableLogs),\n/* harmony export */ \"logger\": () => (/* binding */ logger)\n/* harmony export */ });\nvar noop = function noop() {};\nvar fakeLogger = {\n trace: noop,\n debug: noop,\n log: noop,\n warn: noop,\n info: noop,\n error: noop\n};\nvar exportedLogger = fakeLogger;\n\n// let lastCallTime;\n// function formatMsgWithTimeInfo(type, msg) {\n// const now = Date.now();\n// const diff = lastCallTime ? '+' + (now - lastCallTime) : '0';\n// lastCallTime = now;\n// msg = (new Date(now)).toISOString() + ' | [' + type + '] > ' + msg + ' ( ' + diff + ' ms )';\n// return msg;\n// }\n\nfunction consolePrintFn(type) {\n var func = self.console[type];\n if (func) {\n return func.bind(self.console, \"[\" + type + \"] >\");\n }\n return noop;\n}\nfunction exportLoggerFunctions(debugConfig) {\n for (var _len = arguments.length, functions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n functions[_key - 1] = arguments[_key];\n }\n functions.forEach(function (type) {\n exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);\n });\n}\nfunction enableLogs(debugConfig, id) {\n // check that console is available\n if (self.console && debugConfig === true || typeof debugConfig === 'object') {\n exportLoggerFunctions(debugConfig,\n // Remove out from list here to hard-disable a log-level\n // 'trace',\n 'debug', 'log', 'info', 'warn', 'error');\n // Some browsers don't allow to use bind on console object anyway\n // fallback to default if needed\n try {\n exportedLogger.log(\"Debug logs enabled for \\\"\" + id + \"\\\"\");\n } catch (e) {\n exportedLogger = fakeLogger;\n }\n } else {\n exportedLogger = fakeLogger;\n }\n}\nvar logger = exportedLogger;\n\n/***/ }),\n\n/***/ \"./src/utils/mediakeys-helper.ts\":\n/*!***************************************!*\\\n !*** ./src/utils/mediakeys-helper.ts ***!\n \\***************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"KeySystemFormats\": () => (/* binding */ KeySystemFormats),\n/* harmony export */ \"KeySystemIds\": () => (/* binding */ KeySystemIds),\n/* harmony export */ \"KeySystems\": () => (/* binding */ KeySystems),\n/* harmony export */ \"getKeySystemsForConfig\": () => (/* binding */ getKeySystemsForConfig),\n/* harmony export */ \"getSupportedMediaKeySystemConfigurations\": () => (/* binding */ getSupportedMediaKeySystemConfigurations),\n/* harmony export */ \"keySystemDomainToKeySystemFormat\": () => (/* binding */ keySystemDomainToKeySystemFormat),\n/* harmony export */ \"keySystemFormatToKeySystemDomain\": () => (/* binding */ keySystemFormatToKeySystemDomain),\n/* harmony export */ \"keySystemIdToKeySystemDomain\": () => (/* binding */ keySystemIdToKeySystemDomain),\n/* harmony export */ \"requestMediaKeySystemAccess\": () => (/* binding */ requestMediaKeySystemAccess)\n/* harmony export */ });\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/requestMediaKeySystemAccess\n */\nvar KeySystems;\n\n// Playlist #EXT-X-KEY KEYFORMAT values\n(function (KeySystems) {\n KeySystems[\"CLEARKEY\"] = \"org.w3.clearkey\";\n KeySystems[\"FAIRPLAY\"] = \"com.apple.fps\";\n KeySystems[\"PLAYREADY\"] = \"com.microsoft.playready\";\n KeySystems[\"WIDEVINE\"] = \"com.widevine.alpha\";\n})(KeySystems || (KeySystems = {}));\nvar KeySystemFormats;\n(function (KeySystemFormats) {\n KeySystemFormats[\"CLEARKEY\"] = \"org.w3.clearkey\";\n KeySystemFormats[\"FAIRPLAY\"] = \"com.apple.streamingkeydelivery\";\n KeySystemFormats[\"PLAYREADY\"] = \"com.microsoft.playready\";\n KeySystemFormats[\"WIDEVINE\"] = \"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed\";\n})(KeySystemFormats || (KeySystemFormats = {}));\nfunction keySystemFormatToKeySystemDomain(format) {\n switch (format) {\n case KeySystemFormats.FAIRPLAY:\n return KeySystems.FAIRPLAY;\n case KeySystemFormats.PLAYREADY:\n return KeySystems.PLAYREADY;\n case KeySystemFormats.WIDEVINE:\n return KeySystems.WIDEVINE;\n case KeySystemFormats.CLEARKEY:\n return KeySystems.CLEARKEY;\n }\n}\n\n// System IDs for which we can extract a key ID from \"encrypted\" event PSSH\nvar KeySystemIds;\n(function (KeySystemIds) {\n KeySystemIds[\"WIDEVINE\"] = \"edef8ba979d64acea3c827dcd51d21ed\";\n})(KeySystemIds || (KeySystemIds = {}));\nfunction keySystemIdToKeySystemDomain(systemId) {\n if (systemId === KeySystemIds.WIDEVINE) {\n return KeySystems.WIDEVINE;\n // } else if (systemId === KeySystemIds.PLAYREADY) {\n // return KeySystems.PLAYREADY;\n // } else if (systemId === KeySystemIds.CENC || systemId === KeySystemIds.CLEARKEY) {\n // return KeySystems.CLEARKEY;\n }\n}\n\nfunction keySystemDomainToKeySystemFormat(keySystem) {\n switch (keySystem) {\n case KeySystems.FAIRPLAY:\n return KeySystemFormats.FAIRPLAY;\n case KeySystems.PLAYREADY:\n return KeySystemFormats.PLAYREADY;\n case KeySystems.WIDEVINE:\n return KeySystemFormats.WIDEVINE;\n case KeySystems.CLEARKEY:\n return KeySystemFormats.CLEARKEY;\n }\n}\nfunction getKeySystemsForConfig(config) {\n var drmSystems = config.drmSystems,\n widevineLicenseUrl = config.widevineLicenseUrl;\n var keySystemsToAttempt = drmSystems ? [KeySystems.FAIRPLAY, KeySystems.WIDEVINE, KeySystems.PLAYREADY, KeySystems.CLEARKEY].filter(function (keySystem) {\n return !!drmSystems[keySystem];\n }) : [];\n if (!keySystemsToAttempt[KeySystems.WIDEVINE] && widevineLicenseUrl) {\n keySystemsToAttempt.push(KeySystems.WIDEVINE);\n }\n return keySystemsToAttempt;\n}\nvar requestMediaKeySystemAccess = function () {\n if (typeof self !== 'undefined' && self.navigator && self.navigator.requestMediaKeySystemAccess) {\n return self.navigator.requestMediaKeySystemAccess.bind(self.navigator);\n } else {\n return null;\n }\n}();\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySystemConfiguration\n */\nfunction getSupportedMediaKeySystemConfigurations(keySystem, audioCodecs, videoCodecs, drmSystemOptions) {\n var initDataTypes;\n switch (keySystem) {\n case KeySystems.FAIRPLAY:\n initDataTypes = ['cenc', 'sinf'];\n break;\n case KeySystems.WIDEVINE:\n case KeySystems.PLAYREADY:\n initDataTypes = ['cenc'];\n break;\n case KeySystems.CLEARKEY:\n initDataTypes = ['cenc', 'keyids'];\n break;\n default:\n throw new Error(\"Unknown key-system: \" + keySystem);\n }\n return createMediaKeySystemConfigurations(initDataTypes, audioCodecs, videoCodecs, drmSystemOptions);\n}\nfunction createMediaKeySystemConfigurations(initDataTypes, audioCodecs, videoCodecs, drmSystemOptions) {\n var baseConfig = {\n initDataTypes: initDataTypes,\n persistentState: drmSystemOptions.persistentState || 'not-allowed',\n distinctiveIdentifier: drmSystemOptions.distinctiveIdentifier || 'not-allowed',\n sessionTypes: drmSystemOptions.sessionTypes || [drmSystemOptions.sessionType || 'temporary'],\n audioCapabilities: audioCodecs.map(function (codec) {\n return {\n contentType: \"audio/mp4; codecs=\\\"\" + codec + \"\\\"\",\n robustness: drmSystemOptions.audioRobustness || '',\n encryptionScheme: drmSystemOptions.audioEncryptionScheme || null\n };\n }),\n videoCapabilities: videoCodecs.map(function (codec) {\n return {\n contentType: \"video/mp4; codecs=\\\"\" + codec + \"\\\"\",\n robustness: drmSystemOptions.videoRobustness || '',\n encryptionScheme: drmSystemOptions.videoEncryptionScheme || null\n };\n })\n };\n return [baseConfig];\n}\n\n/***/ }),\n\n/***/ \"./src/utils/mediasource-helper.ts\":\n/*!*****************************************!*\\\n !*** ./src/utils/mediasource-helper.ts ***!\n \\*****************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"getMediaSource\": () => (/* binding */ getMediaSource)\n/* harmony export */ });\n/**\n * MediaSource helper\n */\n\nfunction getMediaSource() {\n return self.MediaSource || self.WebKitMediaSource;\n}\n\n/***/ }),\n\n/***/ \"./src/utils/mp4-tools.ts\":\n/*!********************************!*\\\n !*** ./src/utils/mp4-tools.ts ***!\n \\********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RemuxerTrackIdConfig\": () => (/* binding */ RemuxerTrackIdConfig),\n/* harmony export */ \"appendUint8Array\": () => (/* binding */ appendUint8Array),\n/* harmony export */ \"bin2str\": () => (/* binding */ bin2str),\n/* harmony export */ \"computeRawDurationFromSamples\": () => (/* binding */ computeRawDurationFromSamples),\n/* harmony export */ \"discardEPB\": () => (/* binding */ discardEPB),\n/* harmony export */ \"findBox\": () => (/* binding */ findBox),\n/* harmony export */ \"getDuration\": () => (/* binding */ getDuration),\n/* harmony export */ \"getStartDTS\": () => (/* binding */ getStartDTS),\n/* harmony export */ \"mp4Box\": () => (/* binding */ mp4Box),\n/* harmony export */ \"mp4pssh\": () => (/* binding */ mp4pssh),\n/* harmony export */ \"offsetStartDTS\": () => (/* binding */ offsetStartDTS),\n/* harmony export */ \"parseEmsg\": () => (/* binding */ parseEmsg),\n/* harmony export */ \"parseInitSegment\": () => (/* binding */ parseInitSegment),\n/* harmony export */ \"parsePssh\": () => (/* binding */ parsePssh),\n/* harmony export */ \"parseSEIMessageFromNALu\": () => (/* binding */ parseSEIMessageFromNALu),\n/* harmony export */ \"parseSamples\": () => (/* binding */ parseSamples),\n/* harmony export */ \"parseSegmentIndex\": () => (/* binding */ parseSegmentIndex),\n/* harmony export */ \"parseSinf\": () => (/* binding */ parseSinf),\n/* harmony export */ \"patchEncyptionData\": () => (/* binding */ patchEncyptionData),\n/* harmony export */ \"readSint32\": () => (/* binding */ readSint32),\n/* harmony export */ \"readUint16\": () => (/* binding */ readUint16),\n/* harmony export */ \"readUint32\": () => (/* binding */ readUint32),\n/* harmony export */ \"segmentValidRange\": () => (/* binding */ segmentValidRange),\n/* harmony export */ \"writeUint32\": () => (/* binding */ writeUint32)\n/* harmony export */ });\n/* harmony import */ var _loader_fragment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../loader/fragment */ \"./src/loader/fragment.ts\");\n/* harmony import */ var _typed_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./typed-array */ \"./src/utils/typed-array.ts\");\n/* harmony import */ var _demux_id3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../demux/id3 */ \"./src/demux/id3.ts\");\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _hex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hex */ \"./src/utils/hex.ts\");\n\n\n\n\n\nvar UINT32_MAX = Math.pow(2, 32) - 1;\nvar push = [].push;\n\n// We are using fixed track IDs for driving the MP4 remuxer\n// instead of following the TS PIDs.\n// There is no reason not to do this and some browsers/SourceBuffer-demuxers\n// may not like if there are TrackID \"switches\"\n// See https://github.com/video-dev/hls.js/issues/1331\n// Here we are mapping our internal track types to constant MP4 track IDs\n// With MSE currently one can only have one track of each, and we are muxing\n// whatever video/audio rendition in them.\nvar RemuxerTrackIdConfig = {\n video: 1,\n audio: 2,\n id3: 3,\n text: 4\n};\nfunction bin2str(data) {\n return String.fromCharCode.apply(null, data);\n}\nfunction readUint16(buffer, offset) {\n var val = buffer[offset] << 8 | buffer[offset + 1];\n return val < 0 ? 65536 + val : val;\n}\nfunction readUint32(buffer, offset) {\n var val = readSint32(buffer, offset);\n return val < 0 ? 4294967296 + val : val;\n}\nfunction readSint32(buffer, offset) {\n return buffer[offset] << 24 | buffer[offset + 1] << 16 | buffer[offset + 2] << 8 | buffer[offset + 3];\n}\nfunction writeUint32(buffer, offset, value) {\n buffer[offset] = value >> 24;\n buffer[offset + 1] = value >> 16 & 0xff;\n buffer[offset + 2] = value >> 8 & 0xff;\n buffer[offset + 3] = value & 0xff;\n}\n\n// Find the data for a box specified by its path\nfunction findBox(data, path) {\n var results = [];\n if (!path.length) {\n // short-circuit the search for empty paths\n return results;\n }\n var end = data.byteLength;\n for (var i = 0; i < end;) {\n var size = readUint32(data, i);\n var type = bin2str(data.subarray(i + 4, i + 8));\n var endbox = size > 1 ? i + size : end;\n if (type === path[0]) {\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push(data.subarray(i + 8, endbox));\n } else {\n // recursively search for the next box along the path\n var subresults = findBox(data.subarray(i + 8, endbox), path.slice(1));\n if (subresults.length) {\n push.apply(results, subresults);\n }\n }\n }\n i = endbox;\n }\n\n // we've finished searching all of data\n return results;\n}\nfunction parseSegmentIndex(sidx) {\n var references = [];\n var version = sidx[0];\n\n // set initial offset, we skip the reference ID (not needed)\n var index = 8;\n var timescale = readUint32(sidx, index);\n index += 4;\n\n // TODO: parse earliestPresentationTime and firstOffset\n // usually zero in our case\n var earliestPresentationTime = 0;\n var firstOffset = 0;\n if (version === 0) {\n index += 8;\n } else {\n index += 16;\n }\n\n // skip reserved\n index += 2;\n var startByte = sidx.length + firstOffset;\n var referencesCount = readUint16(sidx, index);\n index += 2;\n for (var i = 0; i < referencesCount; i++) {\n var referenceIndex = index;\n var referenceInfo = readUint32(sidx, referenceIndex);\n referenceIndex += 4;\n var referenceSize = referenceInfo & 0x7fffffff;\n var referenceType = (referenceInfo & 0x80000000) >>> 31;\n if (referenceType === 1) {\n // eslint-disable-next-line no-console\n console.warn('SIDX has hierarchical references (not supported)');\n return null;\n }\n var subsegmentDuration = readUint32(sidx, referenceIndex);\n referenceIndex += 4;\n references.push({\n referenceSize: referenceSize,\n subsegmentDuration: subsegmentDuration,\n // unscaled\n info: {\n duration: subsegmentDuration / timescale,\n start: startByte,\n end: startByte + referenceSize - 1\n }\n });\n startByte += referenceSize;\n\n // Skipping 1 bit for |startsWithSap|, 3 bits for |sapType|, and 28 bits\n // for |sapDelta|.\n referenceIndex += 4;\n\n // skip to next ref\n index = referenceIndex;\n }\n return {\n earliestPresentationTime: earliestPresentationTime,\n timescale: timescale,\n version: version,\n referencesCount: referencesCount,\n references: references\n };\n}\n\n/**\n * Parses an MP4 initialization segment and extracts stream type and\n * timescale values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * moov > trak > mdia > hdlr\n * ```\n * @param initSegment {Uint8Array} the bytes of the init segment\n * @return {InitData} a hash of track type to timescale values or null if\n * the init segment is malformed.\n */\n\nfunction parseInitSegment(initSegment) {\n var result = [];\n var traks = findBox(initSegment, ['moov', 'trak']);\n for (var i = 0; i < traks.length; i++) {\n var trak = traks[i];\n var tkhd = findBox(trak, ['tkhd'])[0];\n if (tkhd) {\n var version = tkhd[0];\n var _index = version === 0 ? 12 : 20;\n var trackId = readUint32(tkhd, _index);\n var mdhd = findBox(trak, ['mdia', 'mdhd'])[0];\n if (mdhd) {\n version = mdhd[0];\n _index = version === 0 ? 12 : 20;\n var timescale = readUint32(mdhd, _index);\n var hdlr = findBox(trak, ['mdia', 'hdlr'])[0];\n if (hdlr) {\n var hdlrType = bin2str(hdlr.subarray(8, 12));\n var type = {\n soun: _loader_fragment__WEBPACK_IMPORTED_MODULE_0__.ElementaryStreamTypes.AUDIO,\n vide: _loader_fragment__WEBPACK_IMPORTED_MODULE_0__.ElementaryStreamTypes.VIDEO\n }[hdlrType];\n if (type) {\n // Parse codec details\n var stsd = findBox(trak, ['mdia', 'minf', 'stbl', 'stsd'])[0];\n var codec = void 0;\n if (stsd) {\n codec = bin2str(stsd.subarray(12, 16));\n // TODO: Parse codec details to be able to build MIME type.\n // stsd.start += 8;\n // const codecBox = findBox(stsd, [codec])[0];\n // if (codecBox) {\n // TODO: Codec parsing support for avc1, mp4a, hevc, av01...\n // }\n }\n\n result[trackId] = {\n timescale: timescale,\n type: type\n };\n result[type] = {\n timescale: timescale,\n id: trackId,\n codec: codec\n };\n }\n }\n }\n }\n }\n var trex = findBox(initSegment, ['moov', 'mvex', 'trex']);\n trex.forEach(function (trex) {\n var trackId = readUint32(trex, 4);\n var track = result[trackId];\n if (track) {\n track.default = {\n duration: readUint32(trex, 12),\n flags: readUint32(trex, 20)\n };\n }\n });\n return result;\n}\nfunction patchEncyptionData(initSegment, decryptdata) {\n if (!initSegment || !decryptdata) {\n return initSegment;\n }\n var keyId = decryptdata.keyId;\n if (keyId && decryptdata.isCommonEncryption) {\n var traks = findBox(initSegment, ['moov', 'trak']);\n traks.forEach(function (trak) {\n var stsd = findBox(trak, ['mdia', 'minf', 'stbl', 'stsd'])[0];\n\n // skip the sample entry count\n var sampleEntries = stsd.subarray(8);\n var encBoxes = findBox(sampleEntries, ['enca']);\n var isAudio = encBoxes.length > 0;\n if (!isAudio) {\n encBoxes = findBox(sampleEntries, ['encv']);\n }\n encBoxes.forEach(function (enc) {\n var encBoxChildren = isAudio ? enc.subarray(28) : enc.subarray(78);\n var sinfBoxes = findBox(encBoxChildren, ['sinf']);\n sinfBoxes.forEach(function (sinf) {\n var tenc = parseSinf(sinf);\n if (tenc) {\n // Look for default key id (keyID offset is always 8 within the tenc box):\n var tencKeyId = tenc.subarray(8, 24);\n if (!tencKeyId.some(function (b) {\n return b !== 0;\n })) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.log(\"[eme] Patching keyId in 'enc\" + (isAudio ? 'a' : 'v') + \">sinf>>tenc' box: \" + _hex__WEBPACK_IMPORTED_MODULE_4__[\"default\"].hexDump(tencKeyId) + \" -> \" + _hex__WEBPACK_IMPORTED_MODULE_4__[\"default\"].hexDump(keyId));\n tenc.set(keyId, 8);\n }\n }\n });\n });\n });\n }\n return initSegment;\n}\nfunction parseSinf(sinf) {\n var schm = findBox(sinf, ['schm'])[0];\n if (schm) {\n var scheme = bin2str(schm.subarray(4, 8));\n if (scheme === 'cbcs' || scheme === 'cenc') {\n return findBox(sinf, ['schi', 'tenc'])[0];\n }\n }\n _utils_logger__WEBPACK_IMPORTED_MODULE_3__.logger.error(\"[eme] missing 'schm' box\");\n return null;\n}\n\n/**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param initData {InitData} a hash of track type to timescale values\n * @param fmp4 {Uint8Array} the bytes of the mp4 fragment\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\nfunction getStartDTS(initData, fmp4) {\n // we need info from two children of each track fragment box\n return findBox(fmp4, ['moof', 'traf']).reduce(function (result, traf) {\n var tfdt = findBox(traf, ['tfdt'])[0];\n var version = tfdt[0];\n var start = findBox(traf, ['tfhd']).reduce(function (result, tfhd) {\n // get the track id from the tfhd\n var id = readUint32(tfhd, 4);\n var track = initData[id];\n if (track) {\n var baseTime = readUint32(tfdt, 4);\n if (version === 1) {\n baseTime *= Math.pow(2, 32);\n baseTime += readUint32(tfdt, 8);\n }\n // assume a 90kHz clock if no timescale was specified\n var scale = track.timescale || 90e3;\n // convert base time to seconds\n var startTime = baseTime / scale;\n if (isFinite(startTime) && (result === null || startTime < result)) {\n return startTime;\n }\n }\n return result;\n }, null);\n if (start !== null && isFinite(start) && (result === null || start < result)) {\n return start;\n }\n return result;\n }, null) || 0;\n}\n\n/*\n For Reference:\n aligned(8) class TrackFragmentHeaderBox\n extends FullBox(‘tfhd’, 0, tf_flags){\n unsigned int(32) track_ID;\n // all the following are optional fields\n unsigned int(64) base_data_offset;\n unsigned int(32) sample_description_index;\n unsigned int(32) default_sample_duration;\n unsigned int(32) default_sample_size;\n unsigned int(32) default_sample_flags\n }\n */\nfunction getDuration(data, initData) {\n var rawDuration = 0;\n var videoDuration = 0;\n var audioDuration = 0;\n var trafs = findBox(data, ['moof', 'traf']);\n for (var i = 0; i < trafs.length; i++) {\n var traf = trafs[i];\n // There is only one tfhd & trun per traf\n // This is true for CMAF style content, and we should perhaps check the ftyp\n // and only look for a single trun then, but for ISOBMFF we should check\n // for multiple track runs.\n var tfhd = findBox(traf, ['tfhd'])[0];\n // get the track id from the tfhd\n var id = readUint32(tfhd, 4);\n var track = initData[id];\n if (!track) {\n continue;\n }\n var trackDefault = track.default;\n var tfhdFlags = readUint32(tfhd, 0) | (trackDefault === null || trackDefault === void 0 ? void 0 : trackDefault.flags);\n var sampleDuration = trackDefault === null || trackDefault === void 0 ? void 0 : trackDefault.duration;\n if (tfhdFlags & 0x000008) {\n // 0x000008 indicates the presence of the default_sample_duration field\n if (tfhdFlags & 0x000002) {\n // 0x000002 indicates the presence of the sample_description_index field, which precedes default_sample_duration\n // If present, the default_sample_duration exists at byte offset 12\n sampleDuration = readUint32(tfhd, 12);\n } else {\n // Otherwise, the duration is at byte offset 8\n sampleDuration = readUint32(tfhd, 8);\n }\n }\n // assume a 90kHz clock if no timescale was specified\n var timescale = track.timescale || 90e3;\n var truns = findBox(traf, ['trun']);\n for (var j = 0; j < truns.length; j++) {\n rawDuration = computeRawDurationFromSamples(truns[j]);\n if (!rawDuration && sampleDuration) {\n var sampleCount = readUint32(truns[j], 4);\n rawDuration = sampleDuration * sampleCount;\n }\n if (track.type === _loader_fragment__WEBPACK_IMPORTED_MODULE_0__.ElementaryStreamTypes.VIDEO) {\n videoDuration += rawDuration / timescale;\n } else if (track.type === _loader_fragment__WEBPACK_IMPORTED_MODULE_0__.ElementaryStreamTypes.AUDIO) {\n audioDuration += rawDuration / timescale;\n }\n }\n }\n if (videoDuration === 0 && audioDuration === 0) {\n // If duration samples are not available in the traf use sidx subsegment_duration\n var sidxDuration = 0;\n var sidxs = findBox(data, ['sidx']);\n for (var _i = 0; _i < sidxs.length; _i++) {\n var sidx = parseSegmentIndex(sidxs[_i]);\n if (sidx !== null && sidx !== void 0 && sidx.references) {\n sidxDuration += sidx.references.reduce(function (dur, ref) {\n return dur + ref.info.duration || 0;\n }, 0);\n }\n }\n return sidxDuration;\n }\n if (videoDuration) {\n return videoDuration;\n }\n return audioDuration;\n}\n\n/*\n For Reference:\n aligned(8) class TrackRunBox\n extends FullBox(‘trun’, version, tr_flags) {\n unsigned int(32) sample_count;\n // the following are optional fields\n signed int(32) data_offset;\n unsigned int(32) first_sample_flags;\n // all fields in the following array are optional\n {\n unsigned int(32) sample_duration;\n unsigned int(32) sample_size;\n unsigned int(32) sample_flags\n if (version == 0)\n { unsigned int(32)\n else\n { signed int(32)\n }[ sample_count ]\n }\n */\nfunction computeRawDurationFromSamples(trun) {\n var flags = readUint32(trun, 0);\n // Flags are at offset 0, non-optional sample_count is at offset 4. Therefore we start 8 bytes in.\n // Each field is an int32, which is 4 bytes\n var offset = 8;\n // data-offset-present flag\n if (flags & 0x000001) {\n offset += 4;\n }\n // first-sample-flags-present flag\n if (flags & 0x000004) {\n offset += 4;\n }\n var duration = 0;\n var sampleCount = readUint32(trun, 4);\n for (var i = 0; i < sampleCount; i++) {\n // sample-duration-present flag\n if (flags & 0x000100) {\n var sampleDuration = readUint32(trun, offset);\n duration += sampleDuration;\n offset += 4;\n }\n // sample-size-present flag\n if (flags & 0x000200) {\n offset += 4;\n }\n // sample-flags-present flag\n if (flags & 0x000400) {\n offset += 4;\n }\n // sample-composition-time-offsets-present flag\n if (flags & 0x000800) {\n offset += 4;\n }\n }\n return duration;\n}\nfunction offsetStartDTS(initData, fmp4, timeOffset) {\n findBox(fmp4, ['moof', 'traf']).forEach(function (traf) {\n findBox(traf, ['tfhd']).forEach(function (tfhd) {\n // get the track id from the tfhd\n var id = readUint32(tfhd, 4);\n var track = initData[id];\n if (!track) {\n return;\n }\n // assume a 90kHz clock if no timescale was specified\n var timescale = track.timescale || 90e3;\n // get the base media decode time from the tfdt\n findBox(traf, ['tfdt']).forEach(function (tfdt) {\n var version = tfdt[0];\n var baseMediaDecodeTime = readUint32(tfdt, 4);\n if (version === 0) {\n baseMediaDecodeTime -= timeOffset * timescale;\n baseMediaDecodeTime = Math.max(baseMediaDecodeTime, 0);\n writeUint32(tfdt, 4, baseMediaDecodeTime);\n } else {\n baseMediaDecodeTime *= Math.pow(2, 32);\n baseMediaDecodeTime += readUint32(tfdt, 8);\n baseMediaDecodeTime -= timeOffset * timescale;\n baseMediaDecodeTime = Math.max(baseMediaDecodeTime, 0);\n var upper = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1));\n var lower = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));\n writeUint32(tfdt, 4, upper);\n writeUint32(tfdt, 8, lower);\n }\n });\n });\n });\n}\n\n// TODO: Check if the last moof+mdat pair is part of the valid range\nfunction segmentValidRange(data) {\n var segmentedRange = {\n valid: null,\n remainder: null\n };\n var moofs = findBox(data, ['moof']);\n if (!moofs) {\n return segmentedRange;\n } else if (moofs.length < 2) {\n segmentedRange.remainder = data;\n return segmentedRange;\n }\n var last = moofs[moofs.length - 1];\n // Offset by 8 bytes; findBox offsets the start by as much\n segmentedRange.valid = (0,_typed_array__WEBPACK_IMPORTED_MODULE_1__.sliceUint8)(data, 0, last.byteOffset - 8);\n segmentedRange.remainder = (0,_typed_array__WEBPACK_IMPORTED_MODULE_1__.sliceUint8)(data, last.byteOffset - 8);\n return segmentedRange;\n}\nfunction appendUint8Array(data1, data2) {\n var temp = new Uint8Array(data1.length + data2.length);\n temp.set(data1);\n temp.set(data2, data1.length);\n return temp;\n}\nfunction parseSamples(timeOffset, track) {\n var seiSamples = [];\n var videoData = track.samples;\n var timescale = track.timescale;\n var trackId = track.id;\n var isHEVCFlavor = false;\n var moofs = findBox(videoData, ['moof']);\n moofs.map(function (moof) {\n var moofOffset = moof.byteOffset - 8;\n var trafs = findBox(moof, ['traf']);\n trafs.map(function (traf) {\n // get the base media decode time from the tfdt\n var baseTime = findBox(traf, ['tfdt']).map(function (tfdt) {\n var version = tfdt[0];\n var result = readUint32(tfdt, 4);\n if (version === 1) {\n result *= Math.pow(2, 32);\n result += readUint32(tfdt, 8);\n }\n return result / timescale;\n })[0];\n if (baseTime !== undefined) {\n timeOffset = baseTime;\n }\n return findBox(traf, ['tfhd']).map(function (tfhd) {\n var id = readUint32(tfhd, 4);\n var tfhdFlags = readUint32(tfhd, 0) & 0xffffff;\n var baseDataOffsetPresent = (tfhdFlags & 0x000001) !== 0;\n var sampleDescriptionIndexPresent = (tfhdFlags & 0x000002) !== 0;\n var defaultSampleDurationPresent = (tfhdFlags & 0x000008) !== 0;\n var defaultSampleDuration = 0;\n var defaultSampleSizePresent = (tfhdFlags & 0x000010) !== 0;\n var defaultSampleSize = 0;\n var defaultSampleFlagsPresent = (tfhdFlags & 0x000020) !== 0;\n var tfhdOffset = 8;\n if (id === trackId) {\n if (baseDataOffsetPresent) {\n tfhdOffset += 8;\n }\n if (sampleDescriptionIndexPresent) {\n tfhdOffset += 4;\n }\n if (defaultSampleDurationPresent) {\n defaultSampleDuration = readUint32(tfhd, tfhdOffset);\n tfhdOffset += 4;\n }\n if (defaultSampleSizePresent) {\n defaultSampleSize = readUint32(tfhd, tfhdOffset);\n tfhdOffset += 4;\n }\n if (defaultSampleFlagsPresent) {\n tfhdOffset += 4;\n }\n if (track.type === 'video') {\n isHEVCFlavor = isHEVC(track.codec);\n }\n findBox(traf, ['trun']).map(function (trun) {\n var version = trun[0];\n var flags = readUint32(trun, 0) & 0xffffff;\n var dataOffsetPresent = (flags & 0x000001) !== 0;\n var dataOffset = 0;\n var firstSampleFlagsPresent = (flags & 0x000004) !== 0;\n var sampleDurationPresent = (flags & 0x000100) !== 0;\n var sampleDuration = 0;\n var sampleSizePresent = (flags & 0x000200) !== 0;\n var sampleSize = 0;\n var sampleFlagsPresent = (flags & 0x000400) !== 0;\n var sampleCompositionOffsetsPresent = (flags & 0x000800) !== 0;\n var compositionOffset = 0;\n var sampleCount = readUint32(trun, 4);\n var trunOffset = 8; // past version, flags, and sample count\n\n if (dataOffsetPresent) {\n dataOffset = readUint32(trun, trunOffset);\n trunOffset += 4;\n }\n if (firstSampleFlagsPresent) {\n trunOffset += 4;\n }\n var sampleOffset = dataOffset + moofOffset;\n for (var ix = 0; ix < sampleCount; ix++) {\n if (sampleDurationPresent) {\n sampleDuration = readUint32(trun, trunOffset);\n trunOffset += 4;\n } else {\n sampleDuration = defaultSampleDuration;\n }\n if (sampleSizePresent) {\n sampleSize = readUint32(trun, trunOffset);\n trunOffset += 4;\n } else {\n sampleSize = defaultSampleSize;\n }\n if (sampleFlagsPresent) {\n trunOffset += 4;\n }\n if (sampleCompositionOffsetsPresent) {\n if (version === 0) {\n compositionOffset = readUint32(trun, trunOffset);\n } else {\n compositionOffset = readSint32(trun, trunOffset);\n }\n trunOffset += 4;\n }\n if (track.type === _loader_fragment__WEBPACK_IMPORTED_MODULE_0__.ElementaryStreamTypes.VIDEO) {\n var naluTotalSize = 0;\n while (naluTotalSize < sampleSize) {\n var naluSize = readUint32(videoData, sampleOffset);\n sampleOffset += 4;\n if (isSEIMessage(isHEVCFlavor, videoData[sampleOffset])) {\n var data = videoData.subarray(sampleOffset, sampleOffset + naluSize);\n parseSEIMessageFromNALu(data, isHEVCFlavor ? 2 : 1, timeOffset + compositionOffset / timescale, seiSamples);\n }\n sampleOffset += naluSize;\n naluTotalSize += naluSize + 4;\n }\n }\n timeOffset += sampleDuration / timescale;\n }\n });\n }\n });\n });\n });\n return seiSamples;\n}\nfunction isHEVC(codec) {\n if (!codec) {\n return false;\n }\n var delimit = codec.indexOf('.');\n var baseCodec = delimit < 0 ? codec : codec.substring(0, delimit);\n return baseCodec === 'hvc1' || baseCodec === 'hev1' ||\n // Dolby Vision\n baseCodec === 'dvh1' || baseCodec === 'dvhe';\n}\nfunction isSEIMessage(isHEVCFlavor, naluHeader) {\n if (isHEVCFlavor) {\n var naluType = naluHeader >> 1 & 0x3f;\n return naluType === 39 || naluType === 40;\n } else {\n var _naluType = naluHeader & 0x1f;\n return _naluType === 6;\n }\n}\nfunction parseSEIMessageFromNALu(unescapedData, headerSize, pts, samples) {\n var data = discardEPB(unescapedData);\n var seiPtr = 0;\n // skip nal header\n seiPtr += headerSize;\n var payloadType = 0;\n var payloadSize = 0;\n var endOfCaptions = false;\n var b = 0;\n while (seiPtr < data.length) {\n payloadType = 0;\n do {\n if (seiPtr >= data.length) {\n break;\n }\n b = data[seiPtr++];\n payloadType += b;\n } while (b === 0xff);\n\n // Parse payload size.\n payloadSize = 0;\n do {\n if (seiPtr >= data.length) {\n break;\n }\n b = data[seiPtr++];\n payloadSize += b;\n } while (b === 0xff);\n var leftOver = data.length - seiPtr;\n if (!endOfCaptions && payloadType === 4 && seiPtr < data.length) {\n endOfCaptions = true;\n var countryCode = data[seiPtr++];\n if (countryCode === 181) {\n var providerCode = readUint16(data, seiPtr);\n seiPtr += 2;\n if (providerCode === 49) {\n var userStructure = readUint32(data, seiPtr);\n seiPtr += 4;\n if (userStructure === 0x47413934) {\n var userDataType = data[seiPtr++];\n\n // Raw CEA-608 bytes wrapped in CEA-708 packet\n if (userDataType === 3) {\n var firstByte = data[seiPtr++];\n var totalCCs = 0x1f & firstByte;\n var enabled = 0x40 & firstByte;\n var totalBytes = enabled ? 2 + totalCCs * 3 : 0;\n var byteArray = new Uint8Array(totalBytes);\n if (enabled) {\n byteArray[0] = firstByte;\n for (var i = 1; i < totalBytes; i++) {\n byteArray[i] = data[seiPtr++];\n }\n }\n samples.push({\n type: userDataType,\n payloadType: payloadType,\n pts: pts,\n bytes: byteArray\n });\n }\n }\n }\n }\n } else if (payloadType === 5 && payloadSize < leftOver) {\n endOfCaptions = true;\n if (payloadSize > 16) {\n var uuidStrArray = [];\n for (var _i2 = 0; _i2 < 16; _i2++) {\n var _b = data[seiPtr++].toString(16);\n uuidStrArray.push(_b.length == 1 ? '0' + _b : _b);\n if (_i2 === 3 || _i2 === 5 || _i2 === 7 || _i2 === 9) {\n uuidStrArray.push('-');\n }\n }\n var length = payloadSize - 16;\n var userDataBytes = new Uint8Array(length);\n for (var _i3 = 0; _i3 < length; _i3++) {\n userDataBytes[_i3] = data[seiPtr++];\n }\n samples.push({\n payloadType: payloadType,\n pts: pts,\n uuid: uuidStrArray.join(''),\n userData: (0,_demux_id3__WEBPACK_IMPORTED_MODULE_2__.utf8ArrayToStr)(userDataBytes),\n userDataBytes: userDataBytes\n });\n }\n } else if (payloadSize < leftOver) {\n seiPtr += payloadSize;\n } else if (payloadSize > leftOver) {\n break;\n }\n }\n}\n\n/**\n * remove Emulation Prevention bytes from a RBSP\n */\nfunction discardEPB(data) {\n var length = data.byteLength;\n var EPBPositions = [];\n var i = 1;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n EPBPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n }\n\n // If no Emulation Prevention Bytes were found just return the original\n // array\n if (EPBPositions.length === 0) {\n return data;\n }\n\n // Create a new array to hold the NAL unit data\n var newLength = length - EPBPositions.length;\n var newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === EPBPositions[0]) {\n // Skip this byte\n sourceIndex++;\n // Remove this position index\n EPBPositions.shift();\n }\n newData[i] = data[sourceIndex];\n }\n return newData;\n}\nfunction parseEmsg(data) {\n var version = data[0];\n var schemeIdUri = '';\n var value = '';\n var timeScale = 0;\n var presentationTimeDelta = 0;\n var presentationTime = 0;\n var eventDuration = 0;\n var id = 0;\n var offset = 0;\n if (version === 0) {\n while (bin2str(data.subarray(offset, offset + 1)) !== '\\0') {\n schemeIdUri += bin2str(data.subarray(offset, offset + 1));\n offset += 1;\n }\n schemeIdUri += bin2str(data.subarray(offset, offset + 1));\n offset += 1;\n while (bin2str(data.subarray(offset, offset + 1)) !== '\\0') {\n value += bin2str(data.subarray(offset, offset + 1));\n offset += 1;\n }\n value += bin2str(data.subarray(offset, offset + 1));\n offset += 1;\n timeScale = readUint32(data, 12);\n presentationTimeDelta = readUint32(data, 16);\n eventDuration = readUint32(data, 20);\n id = readUint32(data, 24);\n offset = 28;\n } else if (version === 1) {\n offset += 4;\n timeScale = readUint32(data, offset);\n offset += 4;\n var leftPresentationTime = readUint32(data, offset);\n offset += 4;\n var rightPresentationTime = readUint32(data, offset);\n offset += 4;\n presentationTime = Math.pow(2, 32) * leftPresentationTime + rightPresentationTime;\n if (!Number.isSafeInteger(presentationTime)) {\n presentationTime = Number.MAX_SAFE_INTEGER;\n // eslint-disable-next-line no-console\n console.warn('Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box');\n }\n eventDuration = readUint32(data, offset);\n offset += 4;\n id = readUint32(data, offset);\n offset += 4;\n while (bin2str(data.subarray(offset, offset + 1)) !== '\\0') {\n schemeIdUri += bin2str(data.subarray(offset, offset + 1));\n offset += 1;\n }\n schemeIdUri += bin2str(data.subarray(offset, offset + 1));\n offset += 1;\n while (bin2str(data.subarray(offset, offset + 1)) !== '\\0') {\n value += bin2str(data.subarray(offset, offset + 1));\n offset += 1;\n }\n value += bin2str(data.subarray(offset, offset + 1));\n offset += 1;\n }\n var payload = data.subarray(offset, data.byteLength);\n return {\n schemeIdUri: schemeIdUri,\n value: value,\n timeScale: timeScale,\n presentationTime: presentationTime,\n presentationTimeDelta: presentationTimeDelta,\n eventDuration: eventDuration,\n id: id,\n payload: payload\n };\n}\nfunction mp4Box(type) {\n for (var _len = arguments.length, payload = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n payload[_key - 1] = arguments[_key];\n }\n var len = payload.length;\n var size = 8;\n var i = len;\n while (i--) {\n size += payload[i].byteLength;\n }\n var result = new Uint8Array(size);\n result[0] = size >> 24 & 0xff;\n result[1] = size >> 16 & 0xff;\n result[2] = size >> 8 & 0xff;\n result[3] = size & 0xff;\n result.set(type, 4);\n for (i = 0, size = 8; i < len; i++) {\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n return result;\n}\nfunction mp4pssh(systemId, keyids, data) {\n if (systemId.byteLength !== 16) {\n throw new RangeError('Invalid system id');\n }\n var version;\n var kids;\n if (keyids) {\n version = 1;\n kids = new Uint8Array(keyids.length * 16);\n for (var ix = 0; ix < keyids.length; ix++) {\n var k = keyids[ix]; // uint8array\n if (k.byteLength !== 16) {\n throw new RangeError('Invalid key');\n }\n kids.set(k, ix * 16);\n }\n } else {\n version = 0;\n kids = new Uint8Array();\n }\n var kidCount;\n if (version > 0) {\n kidCount = new Uint8Array(4);\n if (keyids.length > 0) {\n new DataView(kidCount.buffer).setUint32(0, keyids.length, false);\n }\n } else {\n kidCount = new Uint8Array();\n }\n var dataSize = new Uint8Array(4);\n if (data && data.byteLength > 0) {\n new DataView(dataSize.buffer).setUint32(0, data.byteLength, false);\n }\n return mp4Box([112, 115, 115, 104], new Uint8Array([version, 0x00, 0x00, 0x00 // Flags\n ]), systemId,\n // 16 bytes\n kidCount, kids, dataSize, data || new Uint8Array());\n}\nfunction parsePssh(initData) {\n if (!(initData instanceof ArrayBuffer) || initData.byteLength < 32) {\n return null;\n }\n var result = {\n version: 0,\n systemId: '',\n kids: null,\n data: null\n };\n var view = new DataView(initData);\n var boxSize = view.getUint32(0);\n if (initData.byteLength !== boxSize && boxSize > 44) {\n return null;\n }\n var type = view.getUint32(4);\n if (type !== 0x70737368) {\n return null;\n }\n result.version = view.getUint32(8) >>> 24;\n if (result.version > 1) {\n return null;\n }\n result.systemId = _hex__WEBPACK_IMPORTED_MODULE_4__[\"default\"].hexDump(new Uint8Array(initData, 12, 16));\n var dataSizeOrKidCount = view.getUint32(28);\n if (result.version === 0) {\n if (boxSize - 32 < dataSizeOrKidCount) {\n return null;\n }\n result.data = new Uint8Array(initData, 32, dataSizeOrKidCount);\n } else if (result.version === 1) {\n result.kids = [];\n for (var i = 0; i < dataSizeOrKidCount; i++) {\n result.kids.push(new Uint8Array(initData, 32 + i * 16, 16));\n }\n }\n return result;\n}\n\n/***/ }),\n\n/***/ \"./src/utils/numeric-encoding-utils.ts\":\n/*!*********************************************!*\\\n !*** ./src/utils/numeric-encoding-utils.ts ***!\n \\*********************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"base64Decode\": () => (/* binding */ base64Decode),\n/* harmony export */ \"base64DecodeToStr\": () => (/* binding */ base64DecodeToStr),\n/* harmony export */ \"base64Encode\": () => (/* binding */ base64Encode),\n/* harmony export */ \"base64ToBase64Url\": () => (/* binding */ base64ToBase64Url),\n/* harmony export */ \"base64UrlEncode\": () => (/* binding */ base64UrlEncode),\n/* harmony export */ \"strToBase64Encode\": () => (/* binding */ strToBase64Encode)\n/* harmony export */ });\nfunction base64ToBase64Url(base64encodedStr) {\n return base64encodedStr.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}\nfunction strToBase64Encode(str) {\n return btoa(str);\n}\nfunction base64DecodeToStr(str) {\n return atob(str);\n}\nfunction base64Encode(input) {\n return btoa(String.fromCharCode.apply(String, input));\n}\nfunction base64UrlEncode(input) {\n return base64ToBase64Url(base64Encode(input));\n}\nfunction base64Decode(base64encodedStr) {\n return Uint8Array.from(atob(base64encodedStr), function (c) {\n return c.charCodeAt(0);\n });\n}\n\n/***/ }),\n\n/***/ \"./src/utils/texttrack-utils.ts\":\n/*!**************************************!*\\\n !*** ./src/utils/texttrack-utils.ts ***!\n \\**************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"addCueToTrack\": () => (/* binding */ addCueToTrack),\n/* harmony export */ \"clearCurrentCues\": () => (/* binding */ clearCurrentCues),\n/* harmony export */ \"getCuesInRange\": () => (/* binding */ getCuesInRange),\n/* harmony export */ \"removeCuesInRange\": () => (/* binding */ removeCuesInRange),\n/* harmony export */ \"sendAddTrackEvent\": () => (/* binding */ sendAddTrackEvent)\n/* harmony export */ });\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./logger */ \"./src/utils/logger.ts\");\n\nfunction sendAddTrackEvent(track, videoEl) {\n var event;\n try {\n event = new Event('addtrack');\n } catch (err) {\n // for IE11\n event = document.createEvent('Event');\n event.initEvent('addtrack', false, false);\n }\n event.track = track;\n videoEl.dispatchEvent(event);\n}\nfunction addCueToTrack(track, cue) {\n // Sometimes there are cue overlaps on segmented vtts so the same\n // cue can appear more than once in different vtt files.\n // This avoid showing duplicated cues with same timecode and text.\n var mode = track.mode;\n if (mode === 'disabled') {\n track.mode = 'hidden';\n }\n if (track.cues && !track.cues.getCueById(cue.id)) {\n try {\n track.addCue(cue);\n if (!track.cues.getCueById(cue.id)) {\n throw new Error(\"addCue is failed for: \" + cue);\n }\n } catch (err) {\n _logger__WEBPACK_IMPORTED_MODULE_0__.logger.debug(\"[texttrack-utils]: \" + err);\n var textTrackCue = new self.TextTrackCue(cue.startTime, cue.endTime, cue.text);\n textTrackCue.id = cue.id;\n track.addCue(textTrackCue);\n }\n }\n if (mode === 'disabled') {\n track.mode = mode;\n }\n}\nfunction clearCurrentCues(track) {\n // When track.mode is disabled, track.cues will be null.\n // To guarantee the removal of cues, we need to temporarily\n // change the mode to hidden\n var mode = track.mode;\n if (mode === 'disabled') {\n track.mode = 'hidden';\n }\n if (track.cues) {\n for (var i = track.cues.length; i--;) {\n track.removeCue(track.cues[i]);\n }\n }\n if (mode === 'disabled') {\n track.mode = mode;\n }\n}\nfunction removeCuesInRange(track, start, end, predicate) {\n var mode = track.mode;\n if (mode === 'disabled') {\n track.mode = 'hidden';\n }\n if (track.cues && track.cues.length > 0) {\n var cues = getCuesInRange(track.cues, start, end);\n for (var i = 0; i < cues.length; i++) {\n if (!predicate || predicate(cues[i])) {\n track.removeCue(cues[i]);\n }\n }\n }\n if (mode === 'disabled') {\n track.mode = mode;\n }\n}\n\n// Find first cue starting after given time.\n// Modified version of binary search O(log(n)).\nfunction getFirstCueIndexAfterTime(cues, time) {\n // If first cue starts after time, start there\n if (time < cues[0].startTime) {\n return 0;\n }\n // If the last cue ends before time there is no overlap\n var len = cues.length - 1;\n if (time > cues[len].endTime) {\n return -1;\n }\n var left = 0;\n var right = len;\n while (left <= right) {\n var mid = Math.floor((right + left) / 2);\n if (time < cues[mid].startTime) {\n right = mid - 1;\n } else if (time > cues[mid].startTime && left < len) {\n left = mid + 1;\n } else {\n // If it's not lower or higher, it must be equal.\n return mid;\n }\n }\n // At this point, left and right have swapped.\n // No direct match was found, left or right element must be the closest. Check which one has the smallest diff.\n return cues[left].startTime - time < time - cues[right].startTime ? left : right;\n}\nfunction getCuesInRange(cues, start, end) {\n var cuesFound = [];\n var firstCueInRange = getFirstCueIndexAfterTime(cues, start);\n if (firstCueInRange > -1) {\n for (var i = firstCueInRange, len = cues.length; i < len; i++) {\n var _cue = cues[i];\n if (_cue.startTime >= start && _cue.endTime <= end) {\n cuesFound.push(_cue);\n } else if (_cue.startTime > end) {\n return cuesFound;\n }\n }\n }\n return cuesFound;\n}\n\n/***/ }),\n\n/***/ \"./src/utils/time-ranges.ts\":\n/*!**********************************!*\\\n !*** ./src/utils/time-ranges.ts ***!\n \\**********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * TimeRanges to string helper\n */\n\nvar TimeRanges = {\n toString: function toString(r) {\n var log = '';\n var len = r.length;\n for (var i = 0; i < len; i++) {\n log += \"[\" + r.start(i).toFixed(3) + \"-\" + r.end(i).toFixed(3) + \"]\";\n }\n return log;\n }\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TimeRanges);\n\n/***/ }),\n\n/***/ \"./src/utils/timescale-conversion.ts\":\n/*!*******************************************!*\\\n !*** ./src/utils/timescale-conversion.ts ***!\n \\*******************************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"toMpegTsClockFromTimescale\": () => (/* binding */ toMpegTsClockFromTimescale),\n/* harmony export */ \"toMsFromMpegTsClock\": () => (/* binding */ toMsFromMpegTsClock),\n/* harmony export */ \"toTimescaleFromBase\": () => (/* binding */ toTimescaleFromBase),\n/* harmony export */ \"toTimescaleFromScale\": () => (/* binding */ toTimescaleFromScale)\n/* harmony export */ });\nvar MPEG_TS_CLOCK_FREQ_HZ = 90000;\nfunction toTimescaleFromBase(value, destScale, srcBase, round) {\n if (srcBase === void 0) {\n srcBase = 1;\n }\n if (round === void 0) {\n round = false;\n }\n var result = value * destScale * srcBase; // equivalent to `(value * scale) / (1 / base)`\n return round ? Math.round(result) : result;\n}\nfunction toTimescaleFromScale(value, destScale, srcScale, round) {\n if (srcScale === void 0) {\n srcScale = 1;\n }\n if (round === void 0) {\n round = false;\n }\n return toTimescaleFromBase(value, destScale, 1 / srcScale, round);\n}\nfunction toMsFromMpegTsClock(value, round) {\n if (round === void 0) {\n round = false;\n }\n return toTimescaleFromBase(value, 1000, 1 / MPEG_TS_CLOCK_FREQ_HZ, round);\n}\nfunction toMpegTsClockFromTimescale(value, srcScale) {\n if (srcScale === void 0) {\n srcScale = 1;\n }\n return toTimescaleFromBase(value, MPEG_TS_CLOCK_FREQ_HZ, 1 / srcScale);\n}\n\n/***/ }),\n\n/***/ \"./src/utils/typed-array.ts\":\n/*!**********************************!*\\\n !*** ./src/utils/typed-array.ts ***!\n \\**********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"sliceUint8\": () => (/* binding */ sliceUint8)\n/* harmony export */ });\nfunction sliceUint8(array, start, end) {\n // @ts-expect-error This polyfills IE11 usage of Uint8Array slice.\n // It always exists in the TypeScript definition so fails, but it fails at runtime on IE11.\n return Uint8Array.prototype.slice ? array.slice(start, end) : new Uint8Array(Array.prototype.slice.call(array, start, end));\n}\n\n/***/ }),\n\n/***/ \"./src/utils/xhr-loader.ts\":\n/*!*********************************!*\\\n !*** ./src/utils/xhr-loader.ts ***!\n \\*********************************/\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/logger */ \"./src/utils/logger.ts\");\n/* harmony import */ var _loader_load_stats__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../loader/load-stats */ \"./src/loader/load-stats.ts\");\n\n\nvar AGE_HEADER_LINE_REGEX = /^age:\\s*[\\d.]+\\s*$/m;\nvar XhrLoader = /*#__PURE__*/function () {\n function XhrLoader(config /* HlsConfig */) {\n this.xhrSetup = void 0;\n this.requestTimeout = void 0;\n this.retryTimeout = void 0;\n this.retryDelay = void 0;\n this.config = null;\n this.callbacks = null;\n this.context = void 0;\n this.loader = null;\n this.stats = void 0;\n this.xhrSetup = config ? config.xhrSetup : null;\n this.stats = new _loader_load_stats__WEBPACK_IMPORTED_MODULE_1__.LoadStats();\n this.retryDelay = 0;\n }\n var _proto = XhrLoader.prototype;\n _proto.destroy = function destroy() {\n this.callbacks = null;\n this.abortInternal();\n this.loader = null;\n this.config = null;\n };\n _proto.abortInternal = function abortInternal() {\n var loader = this.loader;\n self.clearTimeout(this.requestTimeout);\n self.clearTimeout(this.retryTimeout);\n if (loader) {\n loader.onreadystatechange = null;\n loader.onprogress = null;\n if (loader.readyState !== 4) {\n this.stats.aborted = true;\n loader.abort();\n }\n }\n };\n _proto.abort = function abort() {\n var _this$callbacks;\n this.abortInternal();\n if ((_this$callbacks = this.callbacks) !== null && _this$callbacks !== void 0 && _this$callbacks.onAbort) {\n this.callbacks.onAbort(this.stats, this.context, this.loader);\n }\n };\n _proto.load = function load(context, config, callbacks) {\n if (this.stats.loading.start) {\n throw new Error('Loader can only be used once.');\n }\n this.stats.loading.start = self.performance.now();\n this.context = context;\n this.config = config;\n this.callbacks = callbacks;\n this.retryDelay = config.retryDelay;\n this.loadInternal();\n };\n _proto.loadInternal = function loadInternal() {\n var config = this.config,\n context = this.context;\n if (!config) {\n return;\n }\n var xhr = this.loader = new self.XMLHttpRequest();\n var stats = this.stats;\n stats.loading.first = 0;\n stats.loaded = 0;\n var xhrSetup = this.xhrSetup;\n try {\n if (xhrSetup) {\n try {\n xhrSetup(xhr, context.url);\n } catch (e) {\n // fix xhrSetup: (xhr, url) => {xhr.setRequestHeader(\"Content-Language\", \"test\");}\n // not working, as xhr.setRequestHeader expects xhr.readyState === OPEN\n xhr.open('GET', context.url, true);\n xhrSetup(xhr, context.url);\n }\n }\n if (!xhr.readyState) {\n xhr.open('GET', context.url, true);\n }\n var headers = this.context.headers;\n if (headers) {\n for (var header in headers) {\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n } catch (e) {\n // IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS\n this.callbacks.onError({\n code: xhr.status,\n text: e.message\n }, context, xhr);\n return;\n }\n if (context.rangeEnd) {\n xhr.setRequestHeader('Range', 'bytes=' + context.rangeStart + '-' + (context.rangeEnd - 1));\n }\n xhr.onreadystatechange = this.readystatechange.bind(this);\n xhr.onprogress = this.loadprogress.bind(this);\n xhr.responseType = context.responseType;\n // setup timeout before we perform request\n self.clearTimeout(this.requestTimeout);\n this.requestTimeout = self.setTimeout(this.loadtimeout.bind(this), config.timeout);\n xhr.send();\n };\n _proto.readystatechange = function readystatechange() {\n var context = this.context,\n xhr = this.loader,\n stats = this.stats;\n if (!context || !xhr) {\n return;\n }\n var readyState = xhr.readyState;\n var config = this.config;\n\n // don't proceed if xhr has been aborted\n if (stats.aborted) {\n return;\n }\n\n // >= HEADERS_RECEIVED\n if (readyState >= 2) {\n // clear xhr timeout and rearm it if readyState less than 4\n self.clearTimeout(this.requestTimeout);\n if (stats.loading.first === 0) {\n stats.loading.first = Math.max(self.performance.now(), stats.loading.start);\n }\n if (readyState === 4) {\n xhr.onreadystatechange = null;\n xhr.onprogress = null;\n var status = xhr.status;\n // http status between 200 to 299 are all successful\n var isArrayBuffer = xhr.responseType === 'arraybuffer';\n if (status >= 200 && status < 300 && (isArrayBuffer && xhr.response || xhr.responseText !== null)) {\n stats.loading.end = Math.max(self.performance.now(), stats.loading.first);\n var data;\n var len;\n if (isArrayBuffer) {\n data = xhr.response;\n len = data.byteLength;\n } else {\n data = xhr.responseText;\n len = data.length;\n }\n stats.loaded = stats.total = len;\n if (!this.callbacks) {\n return;\n }\n var onProgress = this.callbacks.onProgress;\n if (onProgress) {\n onProgress(stats, context, data, xhr);\n }\n if (!this.callbacks) {\n return;\n }\n var response = {\n url: xhr.responseURL,\n data: data\n };\n this.callbacks.onSuccess(response, stats, context, xhr);\n } else {\n // if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error\n if (stats.retry >= config.maxRetry || status >= 400 && status < 499) {\n _utils_logger__WEBPACK_IMPORTED_MODULE_0__.logger.error(status + \" while loading \" + context.url);\n this.callbacks.onError({\n code: status,\n text: xhr.statusText\n }, context, xhr);\n } else {\n // retry\n _utils_logger__WEBPACK_IMPORTED_MODULE_0__.logger.warn(status + \" while loading \" + context.url + \", retrying in \" + this.retryDelay + \"...\");\n // abort and reset internal state\n this.abortInternal();\n this.loader = null;\n // schedule retry\n self.clearTimeout(this.retryTimeout);\n this.retryTimeout = self.setTimeout(this.loadInternal.bind(this), this.retryDelay);\n // set exponential backoff\n this.retryDelay = Math.min(2 * this.retryDelay, config.maxRetryDelay);\n stats.retry++;\n }\n }\n } else {\n // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet\n self.clearTimeout(this.requestTimeout);\n this.requestTimeout = self.setTimeout(this.loadtimeout.bind(this), config.timeout);\n }\n }\n };\n _proto.loadtimeout = function loadtimeout() {\n _utils_logger__WEBPACK_IMPORTED_MODULE_0__.logger.warn(\"timeout while loading \" + this.context.url);\n var callbacks = this.callbacks;\n if (callbacks) {\n this.abortInternal();\n callbacks.onTimeout(this.stats, this.context, this.loader);\n }\n };\n _proto.loadprogress = function loadprogress(event) {\n var stats = this.stats;\n stats.loaded = event.loaded;\n if (event.lengthComputable) {\n stats.total = event.total;\n }\n };\n _proto.getCacheAge = function getCacheAge() {\n var result = null;\n if (this.loader && AGE_HEADER_LINE_REGEX.test(this.loader.getAllResponseHeaders())) {\n var ageHeader = this.loader.getResponseHeader('age');\n result = ageHeader ? parseFloat(ageHeader) : null;\n }\n return result;\n };\n return XhrLoader;\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (XhrLoader);\n\n/***/ }),\n\n/***/ \"./node_modules/eventemitter3/index.js\":\n/*!*********************************************!*\\\n !*** ./node_modules/eventemitter3/index.js ***!\n \\*********************************************/\n/***/ ((module) => {\n\n\"use strict\";\n\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif (true) {\n module.exports = EventEmitter;\n}\n\n\n/***/ }),\n\n/***/ \"./node_modules/url-toolkit/src/url-toolkit.js\":\n/*!*****************************************************!*\\\n !*** ./node_modules/url-toolkit/src/url-toolkit.js ***!\n \\*****************************************************/\n/***/ (function(module) {\n\n// see https://tools.ietf.org/html/rfc1808\n\n(function (root) {\n var URL_REGEX =\n /^(?=((?:[a-zA-Z0-9+\\-.]+:)?))\\1(?=((?:\\/\\/[^\\/?#]*)?))\\2(?=((?:(?:[^?#\\/]*\\/)*[^;?#\\/]*)?))\\3((?:;[^?#]*)?)(\\?[^#]*)?(#[^]*)?$/;\n var FIRST_SEGMENT_REGEX = /^(?=([^\\/?#]*))\\1([^]*)$/;\n var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\n var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/)[^\\/]*(?=\\/)/g;\n\n var URLToolkit = {\n // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\n // E.g\n // With opts.alwaysNormalize = false (default, spec compliant)\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\n // With opts.alwaysNormalize = true (not spec compliant)\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\n buildAbsoluteURL: function (baseURL, relativeURL, opts) {\n opts = opts || {};\n // remove any remaining space and CRLF\n baseURL = baseURL.trim();\n relativeURL = relativeURL.trim();\n if (!relativeURL) {\n // 2a) If the embedded URL is entirely empty, it inherits the\n // entire base URL (i.e., is set equal to the base URL)\n // and we are done.\n if (!opts.alwaysNormalize) {\n return baseURL;\n }\n var basePartsForNormalise = URLToolkit.parseURL(baseURL);\n if (!basePartsForNormalise) {\n throw new Error('Error trying to parse base URL.');\n }\n basePartsForNormalise.path = URLToolkit.normalizePath(\n basePartsForNormalise.path\n );\n return URLToolkit.buildURLFromParts(basePartsForNormalise);\n }\n var relativeParts = URLToolkit.parseURL(relativeURL);\n if (!relativeParts) {\n throw new Error('Error trying to parse relative URL.');\n }\n if (relativeParts.scheme) {\n // 2b) If the embedded URL starts with a scheme name, it is\n // interpreted as an absolute URL and we are done.\n if (!opts.alwaysNormalize) {\n return relativeURL;\n }\n relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\n return URLToolkit.buildURLFromParts(relativeParts);\n }\n var baseParts = URLToolkit.parseURL(baseURL);\n if (!baseParts) {\n throw new Error('Error trying to parse base URL.');\n }\n if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\n // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\n // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\n var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\n baseParts.netLoc = pathParts[1];\n baseParts.path = pathParts[2];\n }\n if (baseParts.netLoc && !baseParts.path) {\n baseParts.path = '/';\n }\n var builtParts = {\n // 2c) Otherwise, the embedded URL inherits the scheme of\n // the base URL.\n scheme: baseParts.scheme,\n netLoc: relativeParts.netLoc,\n path: null,\n params: relativeParts.params,\n query: relativeParts.query,\n fragment: relativeParts.fragment,\n };\n if (!relativeParts.netLoc) {\n // 3) If the embedded URL's <net_loc> is non-empty, we skip to\n // Step 7. Otherwise, the embedded URL inherits the <net_loc>\n // (if any) of the base URL.\n builtParts.netLoc = baseParts.netLoc;\n // 4) If the embedded URL path is preceded by a slash \"/\", the\n // path is not relative and we skip to Step 7.\n if (relativeParts.path[0] !== '/') {\n if (!relativeParts.path) {\n // 5) If the embedded URL path is empty (and not preceded by a\n // slash), then the embedded URL inherits the base URL path\n builtParts.path = baseParts.path;\n // 5a) if the embedded URL's <params> is non-empty, we skip to\n // step 7; otherwise, it inherits the <params> of the base\n // URL (if any) and\n if (!relativeParts.params) {\n builtParts.params = baseParts.params;\n // 5b) if the embedded URL's <query> is non-empty, we skip to\n // step 7; otherwise, it inherits the <query> of the base\n // URL (if any) and we skip to step 7.\n if (!relativeParts.query) {\n builtParts.query = baseParts.query;\n }\n }\n } else {\n // 6) The last segment of the base URL's path (anything\n // following the rightmost slash \"/\", or the entire path if no\n // slash is present) is removed and the embedded URL's path is\n // appended in its place.\n var baseURLPath = baseParts.path;\n var newPath =\n baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) +\n relativeParts.path;\n builtParts.path = URLToolkit.normalizePath(newPath);\n }\n }\n }\n if (builtParts.path === null) {\n builtParts.path = opts.alwaysNormalize\n ? URLToolkit.normalizePath(relativeParts.path)\n : relativeParts.path;\n }\n return URLToolkit.buildURLFromParts(builtParts);\n },\n parseURL: function (url) {\n var parts = URL_REGEX.exec(url);\n if (!parts) {\n return null;\n }\n return {\n scheme: parts[1] || '',\n netLoc: parts[2] || '',\n path: parts[3] || '',\n params: parts[4] || '',\n query: parts[5] || '',\n fragment: parts[6] || '',\n };\n },\n normalizePath: function (path) {\n // The following operations are\n // then applied, in order, to the new path:\n // 6a) All occurrences of \"./\", where \".\" is a complete path\n // segment, are removed.\n // 6b) If the path ends with \".\" as a complete path segment,\n // that \".\" is removed.\n path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\n // 6c) All occurrences of \"<segment>/../\", where <segment> is a\n // complete path segment not equal to \"..\", are removed.\n // Removal of these path segments is performed iteratively,\n // removing the leftmost matching pattern on each iteration,\n // until no matching pattern remains.\n // 6d) If the path ends with \"<segment>/..\", where <segment> is a\n // complete path segment not equal to \"..\", that\n // \"<segment>/..\" is removed.\n while (\n path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length\n ) {}\n return path.split('').reverse().join('');\n },\n buildURLFromParts: function (parts) {\n return (\n parts.scheme +\n parts.netLoc +\n parts.path +\n parts.params +\n parts.query +\n parts.fragment\n );\n },\n };\n\n if (true)\n module.exports = URLToolkit;\n else {}\n})(this);\n\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = __webpack_modules__;\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/compat get default export */\n/******/ \t(() => {\n/******/ \t\t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t\t__webpack_require__.n = (module) => {\n/******/ \t\t\tvar getter = module && module.__esModule ?\n/******/ \t\t\t\t() => (module['default']) :\n/******/ \t\t\t\t() => (module);\n/******/ \t\t\t__webpack_require__.d(getter, { a: getter });\n/******/ \t\t\treturn getter;\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t(() => {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = (exports, definition) => {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t(() => {\n/******/ \t\t__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\n/******/ \t})();\n/******/ \t\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\n/******/ \t\n/******/ \t// module factories are used so entry inlining is disabled\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \tvar __webpack_exports__ = __webpack_require__(\"./src/hls.ts\");\n/******/ \t__webpack_exports__ = __webpack_exports__[\"default\"];\n/******/ \t\n/******/ \treturn __webpack_exports__;\n/******/ })()\n;\n});\n//# sourceMappingURL=hls.light.js.map"],"names":["factory","window","__webpack_modules__","__unused_webpack_module","__webpack_exports__","r","d","_controller_abr_controller__WEBPACK_IMPORTED_MODULE_0__","_controller_audio_stream_controller__WEBPACK_IMPORTED_MODULE_1__","_controller_audio_stream_controller__WEBPACK_IMPORTED_MODULE_1___default","n","_controller_buffer_controller__WEBPACK_IMPORTED_MODULE_2__","_controller_cap_level_controller__WEBPACK_IMPORTED_MODULE_3__","_controller_fps_controller__WEBPACK_IMPORTED_MODULE_4__","_utils_xhr_loader__WEBPACK_IMPORTED_MODULE_5__","_utils_fetch_loader__WEBPACK_IMPORTED_MODULE_6__","_utils_mediakeys_helper__WEBPACK_IMPORTED_MODULE_7__","_utils_logger__WEBPACK_IMPORTED_MODULE_8__","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","_objectSpread","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","value","arg","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","String","Number","_toPrimitive","_toPropertyKey","configurable","writable","hlsDefaultConfig","autoStartLoad","startPosition","defaultAudioCodec","debug","capLevelOnFPSDrop","capLevelToPlayerSize","ignoreDevicePixelRatio","initialLiveManifestSize","maxBufferLength","backBufferLength","Infinity","maxBufferSize","maxBufferHole","highBufferWatchdogPeriod","nudgeOffset","nudgeMaxRetry","maxFragLookUpTolerance","liveSyncDurationCount","liveMaxLatencyDurationCount","liveSyncDuration","liveMaxLatencyDuration","maxLiveSyncPlaybackRate","liveDurationInfinity","liveBackBufferLength","maxMaxBufferLength","enableWorker","enableSoftwareAES","manifestLoadingTimeOut","manifestLoadingMaxRetry","manifestLoadingRetryDelay","manifestLoadingMaxRetryTimeout","startLevel","levelLoadingTimeOut","levelLoadingMaxRetry","levelLoadingRetryDelay","levelLoadingMaxRetryTimeout","fragLoadingTimeOut","fragLoadingMaxRetry","fragLoadingRetryDelay","fragLoadingMaxRetryTimeout","startFragPrefetch","fpsDroppedMonitoringPeriod","fpsDroppedMonitoringThreshold","appendErrorMaxRetry","loader","fLoader","pLoader","xhrSetup","licenseXhrSetup","licenseResponseCallback","abrController","bufferController","capLevelController","fpsController","stretchShortVideoTrack","maxAudioFramesDrift","forceKeyFrameOnDiscontinuity","abrEwmaFastLive","abrEwmaSlowLive","abrEwmaFastVoD","abrEwmaSlowVoD","abrEwmaDefaultEstimate","abrBandWidthFactor","abrBandWidthUpFactor","abrMaxWithRealBitrate","maxStarvationDelay","maxLoadingDelay","minAutoBitrate","emeEnabled","widevineLicenseUrl","drmSystems","drmSystemOptions","requestMediaKeySystemAccessFunc","requestMediaKeySystemAccess","testBandwidth","progressive","lowLatencyMode","cmcd","enableDateRangeMetadataCues","enableEmsgMetadataCues","enableID3MetadataCues","cueHandler","enableWebVTT","enableIMSC1","enableCEA708Captions","captionsTextTrack1Label","captionsTextTrack1LanguageCode","captionsTextTrack2Label","captionsTextTrack2LanguageCode","captionsTextTrack3Label","captionsTextTrack3LanguageCode","captionsTextTrack4Label","captionsTextTrack4LanguageCode","renderTextTracksNatively","subtitleStreamController","subtitleTrackController","timelineController","audioStreamController","audioTrackController","emeController","cmcdController","mergeConfig","defaultConfig","userConfig","Error","enableStreamingMode","config","currentLoader","logger","log","fetchSupported","_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__","_utils_ewma_bandwidth_estimator__WEBPACK_IMPORTED_MODULE_1__","_events__WEBPACK_IMPORTED_MODULE_2__","_errors__WEBPACK_IMPORTED_MODULE_3__","_types_loader__WEBPACK_IMPORTED_MODULE_4__","_utils_logger__WEBPACK_IMPORTED_MODULE_5__","_defineProperties","props","descriptor","__WEBPACK_DEFAULT_EXPORT__","AbrController","hls","lastLoadedFragLevel","_nextAutoLevel","timer","onCheck","_abandonRulesCheck","fragCurrent","partCurrent","bitrateTestDelay","bwEstimator","registerListeners","Constructor","protoProps","staticProps","_proto","on","Events","FRAG_LOADING","onFragLoading","FRAG_LOADED","onFragLoaded","FRAG_BUFFERED","onFragBuffered","LEVEL_LOADED","onLevelLoaded","ERROR","onError","unregisterListeners","off","destroy","clearTimer","event","data","_data$part","frag","type","PlaylistLevelType","MAIN","part","self","setInterval","details","live","update","autoLevelEnabled","media","stats","duration","aborted","loaded","total","level","paused","playbackRate","readyState","bufferInfo","mainForwardBufferInfo","requestDelay","performance","now","loading","start","Math","abs","loadedFirstByte","first","bwEstimate","getEstimate","levels","minAutoLevel","expectedLen","max","round","maxBitrate","loadRate","fragLoadedDelay","bufferStarvationDelay","len","nextLoadLevel","fragLevelNextLoadedDelay","POSITIVE_INFINITY","levelNextBitrate","warn","sn","index","isFiniteNumber","toFixed","sample","keyLoader","abortRequests","trigger","FRAG_LOAD_EMERGENCY_ABORTED","_ref","loadedBytes","bytes","loadedDuration","realBitrate","bitrateTest","fragBufferedData","id","processingMs","parsing","end","_data$frag","ErrorTypes","KEY_SYSTEM_ERROR","ErrorDetails","FRAG_LOAD_ERROR","FRAG_LOAD_TIMEOUT","KEY_LOAD_ERROR","KEY_LOAD_TIMEOUT","clearInterval","getNextABRAutoLevel","maxAutoLevel","currentFragDuration","avgbw","bestLevel","findBestLevel","trace","min","bwFactor","bwUpFactor","currentBw","maxFetchDuration","_level$details","currentLevel","currentCodecSet","codecSet","levelInfo","levelDetails","avgDuration","partTarget","averagetargetduration","adjustedbw","bitrate","fetchDuration","get","forcedAutoLevel","canEstimate","nextABRAutoLevel","loadError","set","nextLevel","_types_level__WEBPACK_IMPORTED_MODULE_0__","_level_helper__WEBPACK_IMPORTED_MODULE_1__","_utils_logger__WEBPACK_IMPORTED_MODULE_2__","BasePlaylistController","logPrefix","requestScheduled","canLoad","retryCount","fatal","NETWORK_ERROR","stopLoad","clearTimeout","startLoad","loadPlaylist","switchParams","playlistUri","previous","renditionReports","attr","uri","URL","URI","url","href","error","slice","msn","parseInt","lastPartSn","lastPartIndex","currentGoal","age","targetduration","HlsUrlParameters","HlsSkip","No","hlsUrlParameters","shouldLoadTrack","track","playlistLoaded","previousDetails","_this","elapsed","advancedDateTime","Date","reloaded","advanced","fragments","mergeDetails","deliveryDirectives","canBlockReload","endSN","endSn","lastPart","lastAdvanced","cdnAge","ageHeader","tuneInGoal","segments","floor","getDeliveryDirectives","position","distanceToLiveEdgeMs","edge","reloadInterval","computeReloadInterval","updated","estimatedTimeUntilUpdate","setTimeout","previousDeliveryDirectives","skip","getSkipValue","deltaUpdateFailed","retryLoadingOrFail","errorEvent","_errorEvent$context","_this2","retry","indexOf","context","delay","pow","_task_loop__WEBPACK_IMPORTED_MODULE_1__","_fragment_tracker__WEBPACK_IMPORTED_MODULE_2__","_utils_buffer_helper__WEBPACK_IMPORTED_MODULE_3__","_utils_logger__WEBPACK_IMPORTED_MODULE_4__","_events__WEBPACK_IMPORTED_MODULE_5__","_errors__WEBPACK_IMPORTED_MODULE_6__","_types_transmuxer__WEBPACK_IMPORTED_MODULE_7__","_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_8__","_utils_discontinuities__WEBPACK_IMPORTED_MODULE_9__","_fragment_finders__WEBPACK_IMPORTED_MODULE_10__","_level_helper__WEBPACK_IMPORTED_MODULE_11__","_loader_fragment_loader__WEBPACK_IMPORTED_MODULE_12__","_crypt_decrypter__WEBPACK_IMPORTED_MODULE_13__","_utils_time_ranges__WEBPACK_IMPORTED_MODULE_14__","_types_loader__WEBPACK_IMPORTED_MODULE_15__","_setPrototypeOf","o","p","setPrototypeOf","__proto__","State","STOPPED","IDLE","KEY_LOADING","FRAG_LOADING_WAITING_RETRY","WAITING_TRACK","PARSING","PARSED","ENDED","WAITING_INIT_PTS","WAITING_LEVEL","BaseStreamController","_TaskLoop","subClass","superClass","fragmentTracker","fragPrevious","transmuxer","_state","mediaBuffer","lastCurrentTime","nextLoadPosition","loadedmetadata","fragLoadError","retryDate","fragmentLoader","levelLastLoaded","startFragRequested","decrypter","initPTS","onvseeking","onvended","LEVEL_SWITCHING","onLevelSwitching","ReferenceError","_assertThisInitialized","create","constructor","doTick","onTickEnd","abort","removeFragment","resetTransmuxer","clearNextTick","state","_streamEnded","nextStart","partList","BufferHelper","isBuffered","playlistType","isEndListAppended","getLevelDetails","_this$levels$this$lev","onMediaAttached","onMediaSeeking","onMediaEnded","addEventListener","onMediaDetaching","ended","removeEventListener","detach","removeAllFragments","currentTime","resetLoadingState","tolerance","fragStartOffset","fragEndOffset","pastFragment","tickImmediate","onHandlerDestroying","onHandlerDestroyed","loadFragment","targetBufferTime","_loadFragForPlayback","_doFragLoad","fragContextChanged","chunkCount","_handleFragmentLoadProgress","then","_handleFragmentLoadComplete","catch","reason","resetFragmentLoading","flushMainBuffer","startOffset","endOffset","flushScope","BUFFER_FLUSHING","_loadInitSegment","_this3","payload","decryptData","decryptdata","byteLength","iv","method","startTime","decrypt","Uint8Array","buffer","decryptedData","endTime","FRAG_DECRYPTED","tstart","tdecrypt","console","assert","buffering","tick","urlId","fragBufferedComplete","_frag$startPTS","_frag$endPTS","_this$fragCurrent","_this$fragPrevious","startPTS","NaN","endPTS","toString","getBuffered","buffered","seekToStartPos","fragLoadedEndData","partsLoaded","complete","some","fragLoaded","chunkMeta","ChunkMetadata","flush","progressCallback","_frag$decryptdata","_this4","keyLoadingPromise","encrypted","encryptedFragments","loadClear","startSN","load","keyLoadedData","KEY_LOADED","throwIfFragContextChanged","fragmentHint","partIndex","getNextPart","cc","parseFloat","doFragPartsLoad","handleFragLoadError","loadedEndOfParts","Promise","resolve","dataOnProgress","all","fragLoadedData","_this5","reject","loadPartIndex","loadPart","partLoadedData","loadedPart","nextPart","fragment","INTERNAL_ABORTED","handleFragLoadAborted","OTHER_ERROR","INTERNAL_EXCEPTION","err","_handleTransmuxerFlush","getCurrentContext","updateLevelTiming","partial","levelIndex","getPartWith","getFragmentWithSN","bufferFragmentData","data1","data2","appendUint8Array","segment","parent","BUFFER_APPENDING","dropped","independent","flushBufferGap","fragDuration","segmentFraction","getFwdBufferInfo","bufferable","pos","getLoadPosition","bufferedFragAtPos","getBufferedFrag","getMaxBufferLength","levelBitrate","maxBufLen","reduceMaxBufferLength","threshold","minLength","getNextFragment","fragLen","PTSKnown","getInitialLiveFragment","liveSyncPosition","partEnd","fragmentEnd","getFragmentAtPosition","mapToInitFragWhenRequired","initSegment","contiguous","independentAttrOmitted","hasProgramDateTime","programDateTime","findFragmentByPDT","endProgramDateTime","targetSN","fragNext","findFragWithCC","liveStart","bufferEnd","loadingParts","concat","lookupTolerance","findFragmentByPTS","curSNIdx","getState","FragmentState","OK","nextFrag","synchronizeToLiveEdge","withinSlidingWindow","maxLatency","alignPlaylists","lastLevel","slidingStart","firstLevelLoad","aligned","alignedSliding","alignStream","alignedSlidingStart","waitForCdnTuneIn","partHoldBack","setStartPosition","sliding","startTimeOffset","totalduration","onFragmentOrKeyLoadError","filterType","levelRetry","AUDIO","afterBufferFlushed","bufferType","bufferedTimeRanges","detectEvictedFragments","resetStartWhenNotLoaded","_this6","elementaryStreams","reduce","result","info","parsedDuration","drift","updateFragPTSDTS","startDTS","endDTS","LEVEL_PTS_UPDATED","FRAG_PARSED","nextState","previousState","_events__WEBPACK_IMPORTED_MODULE_1__","_utils_buffer_helper__WEBPACK_IMPORTED_MODULE_4__","_utils_mediasource_helper__WEBPACK_IMPORTED_MODULE_5__","_loader_fragment__WEBPACK_IMPORTED_MODULE_6__","_buffer_operation_queue__WEBPACK_IMPORTED_MODULE_7__","MediaSource","getMediaSource","VIDEO_CODEC_PROFILE_REPACE","BufferController","_objectUrl","operationQueue","listeners","bufferCodecEventsExpected","_bufferCodecEventsTotal","mediaSource","lastMpegAudioChunk","appendError","tracks","pendingTracks","sourceBuffer","_onMediaSourceOpen","_onMediaEmptied","updateMediaElementDuration","MEDIA_ATTACHED","checkPendingTracks","_onMediaSourceClose","_onMediaSourceEnded","src","_initSourceBuffer","hasSourceTypes","getSourceBufferTypes","MEDIA_ATTACHING","onMediaAttaching","MEDIA_DETACHING","MANIFEST_PARSED","onManifestParsed","BUFFER_RESET","onBufferReset","onBufferAppending","BUFFER_CODECS","onBufferCodecs","BUFFER_EOS","onBufferEos","onBufferFlushing","LEVEL_UPDATED","onLevelUpdated","onFragParsed","FRAG_CHANGED","onFragChanged","audio","video","audiovideo","codecEvents","altAudio","ms","createObjectURL","endOfStream","message","revokeObjectURL","removeAttribute","MEDIA_DETACHED","sb","removeBufferListeners","removeSourceBuffer","sourceBufferCount","trackName","changeType","_data$trackName","codec","levelCodec","container","metadata","currentCodec","replace","nextCodec","mimeType","appendChangeType","operation","execute","shiftAndExecuteNext","onStart","onComplete","e","append","eventData","chunkStats","bufferAppendingStart","fragBuffering","partBuffering","audioTrack","checkTimestampOffset","fragStart","executeStart","delta","timestampOffset","appendExecutor","executeEnd","timeRanges","_type","BUFFER_APPENDED","MEDIA_ERROR","BUFFER_APPEND_ERROR","code","DOMException","QUOTA_EXCEEDED_ERR","BUFFER_FULL_ERROR","flushOperation","removeExecutor","BUFFER_FLUSHED","_this7","buffersAppendedTo","ElementaryStreamTypes","AUDIOVIDEO","VIDEO","blockBuffers","flushBackBuffer","_this8","acc","ending","sourceBufferTypes","targetDuration","levelTargetDuration","maxBackBufferLength","targetBackBufferPosition","BACK_BUFFER_REACHED","LIVE_BACK_BUFFER_REACHED","levelDuration","mediaDuration","msDuration","updateSeekableRange","setLiveSeekableRange","pendingTracksCount","createSourceBuffers","buffers","BUFFER_INCOMPATIBLE_CODECS_ERROR","executeNext","tracksCreated","addSourceBuffer","sbName","addBufferListener","_onSBUpdateStart","_onSBUpdateEnd","_onSBUpdateError","BUFFER_ADD_CODEC_ERROR","BUFFER_CREATED","current","BUFFER_APPENDING_ERROR","removeStart","removeEnd","updating","remove","appendBuffer","onUnblocked","_this9","blockingOperations","map","appendBlocker","fn","listener","l","_utils_logger__WEBPACK_IMPORTED_MODULE_0__","BufferOperationQueue","sourceBufferReference","queues","queue","insertAbort","unshift","promise","shift","_events__WEBPACK_IMPORTED_MODULE_0__","CapLevelController","autoLevelCapping","firstLevel","restrictedLevels","streamController","clientRect","setStreamController","unregisterListener","stopCapping","FPS_DROP_LEVEL_CAPPING","onFpsDropLevelCapping","isLevelAllowed","droppedLevel","HTMLVideoElement","startCapping","detectPlayerSize","mediaHeight","mediaWidth","getMaxLevel","nextLevelSwitch","capLevelIndex","validLevels","getMaxLevelByMediaSize","getDimensions","boundsRect","width","height","getBoundingClientRect","right","left","bottom","top","curLevel","maxLevelIndex","contentScaleFactor","pixelRatio","devicePixelRatio","_utils_logger__WEBPACK_IMPORTED_MODULE_1__","FPSController","isVideoPlaybackQualityAvailable","lastTime","lastDroppedFrames","lastDecodedFrames","getVideoPlaybackQuality","checkFPSInterval","checkFPS","decodedFrames","droppedFrames","currentPeriod","currentDropped","currentDecoded","droppedFPS","FPS_DROP","totalDroppedFrames","videoPlaybackQuality","totalVideoFrames","droppedVideoFrames","webkitDecodedFrameCount","webkitDroppedFrameCount","_utils_binary_search__WEBPACK_IMPORTED_MODULE_1__","PDTValue","Array","isArray","seg","pdtWithinToleranceTest","fragmentWithinToleranceTest","foundFragment","search","candidate","candidateLookupTolerance","deltaPTS","pdtBufferEnd","_types_loader__WEBPACK_IMPORTED_MODULE_1__","FragmentTracker","activeFragment","activeParts","endListFragments","bufferPadding","_registerListeners","onBufferAppended","_unregisterListeners","getAppendedFrag","levelType","activePart","appendedPTS","fragmentEntity","body","elementaryStream","timeRange","esData","range","time","isNotBuffered","isTimeBuffered","detectPartialFragments","fragKey","getFragmentKey","streamInfo","getBufferedTimes","endList","fragBuffered","minEndPTS","maxStartPTS","getPartialFragment","timePadding","bestFragment","bestOverlap","isPartial","lastFragmentEntity","PARTIAL","APPENDING","NOT_LOADED","rangeEnd","hasFragment","removeFragmentsInRange","clearElementaryStreamInfo","_fragmentEntity$range","_fragmentEntity$range2","_utils_buffer_helper__WEBPACK_IMPORTED_MODULE_0__","_errors__WEBPACK_IMPORTED_MODULE_1__","_utils_logger__WEBPACK_IMPORTED_MODULE_3__","STALL_MINIMUM_DURATION_MS","MAX_START_GAP_JUMP","SKIP_BUFFER_HOLE_STEP_SECONDS","SKIP_BUFFER_RANGE_START","GapController","nudgeRetry","stallReported","stalled","moved","seeking","poll","activeFrag","seeked","beginSeek","hasEnoughBuffer","noBufferGap","startJump","maxStartGapJump","_trySkipBufferHole","tnow","stalledDuration","_reportStall","bufferedWithHoles","_tryFixBufferStall","_stalledDuration","stalledDurationMs","_tryNudgeBuffer","JSON","stringify","BUFFER_STALLED_ERROR","lastEndTime","targetTime","BUFFER_SEEK_OVER_HOLE","BUFFER_NUDGE_ON_STALL","_utils_texttrack_utils__WEBPACK_IMPORTED_MODULE_2__","_demux_id3__WEBPACK_IMPORTED_MODULE_3__","_loader_date_range__WEBPACK_IMPORTED_MODULE_4__","_types_demuxer__WEBPACK_IMPORTED_MODULE_5__","getCueClass","WebKitDataCue","VTTCue","TextTrackCue","MAX_CUE_ENDTIME","Cue","MAX_VALUE","dateRangeDateToTimelineSeconds","date","offset","getTime","ID3TrackController","id3Track","dateRangeCuesAppended","MANIFEST_LOADING","onManifestLoading","FRAG_PARSING_METADATA","onFragParsingMetadata","clearCurrentCues","createTrack","getID3Track","textTracks","mode","textTrack","kind","label","sendAddTrackEvent","addTextTrack","_this$hls$config","samples","MetadataSchema","emsg","frames","getID3Frames","pts","j","frame","isTimeStampFrame","updateId3CueEnds","cue","addCue","_this$id3Track","cues","predicate","_hls$config","audioId3","removeCuesInRange","_ref2","dateRanges","ids","idsToRemove","includes","_loop","removeCue","lastFragment","dateTimeOffset","_loop2","_i","dateRange","appendedDateRangeCues","durationKnown","startDate","endDate","endOnNext","nextDateRangeWithSameClass","filterMapArray","class","sort","a","b","str","attributes","DateRangeAttribute","ID","CLASS","START_DATE","DURATION","END_DATE","END_ON_NEXT","SCTE35_OUT","SCTE35_IN","from","split","_errors__WEBPACK_IMPORTED_MODULE_0__","LatencyController","stallCount","_latency","timeupdateHandler","timeupdate","latency","computeLatency","_this$config","targetLatency","distanceFromTarget","inLiveRange","forwardBufferLength","rate","exp","edgeStalled","estimateLiveEdge","liveEdge","holdBack","_this$config2","maxLiveSyncOnStallIncrease","syncPosition","maxLevelUpdateAge","bufferedRanges","_errors__WEBPACK_IMPORTED_MODULE_2__","_utils_codecs__WEBPACK_IMPORTED_MODULE_3__","_level_helper__WEBPACK_IMPORTED_MODULE_4__","_base_playlist_controller__WEBPACK_IMPORTED_MODULE_5__","_types_loader__WEBPACK_IMPORTED_MODULE_6__","chromeOrFirefox","test","navigator","userAgent","toLowerCase","LevelController","_BasePlaylistControll","_levels","_firstLevel","_startLevel","currentLevelIndex","manualLevelIndex","onParsedComplete","MANIFEST_LOADED","onManifestLoaded","AUDIO_TRACK_SWITCHED","onAudioTrackSwitched","bitrateStart","levelFromSet","audioTracks","subtitleTracks","levelSet","resolutionFound","videoCodecFound","audioCodecFound","levelParsed","attrs","videoCodec","audioCodec","levelKey","RESOLUTION","CODECS","Level","addGroupId","SUBTITLES","isCodecSupportedInMp4","assignTrackIdsByGroup","subtitles","SCORE","decimalFloatingPoint","audioOnly","edata","sessionData","sessionKeys","t","forceStartLoad","MANIFEST_INCOMPATIBLE_CODECS_ERROR","_data$level","PlaylistContextType","AUDIO_TRACK","audioGroupIds","groupId","SUBTITLE_TRACK","textGroupIds","redundantFailover","levelError","levelSwitch","variantLevelIndex","_level","fragmentError","KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED","restrictedHdcpLevel","maxHdcpLevel","HdcpLevels","FRAG_PARSING_ERROR","KEY_SYSTEM_NO_SESSION","LEVEL_LOAD_ERROR","LEVEL_LOAD_TIMEOUT","REMUX_ALLOC_ERROR","recoverLevel","errorDetails","redundantLevels","nextAutoLevel","newUrlId","_ref3","_data$deliveryDirecti2","_data$deliveryDirecti","audioGroupId","addDirectives","LEVEL_LOADING","removeLevel","filterLevelAndGroupByIdIndex","LEVELS_UPDATED","newLevel","_levels$newLevel","LEVEL_SWITCH_ERROR","lastLevelIndex","levelSwitchingData","_urlId","configStartLevel","_loader_date_range__WEBPACK_IMPORTED_MODULE_2__","groups","updatePTS","fromIdx","toIdx","updateFromToPTS","fragFrom","fragTo","fragToPTS","fragStartPts","fragEndPts","fragIdx","oldDetails","newDetails","currentInitSegment","oldFragments","oldInit","PTSFrag","oldDateRanges","deltaDateRanges","recentlyRemovedDateranges","ccOffset","mapFragmentIntersection","oldFrag","newFrag","relurl","_currentInitSegment","skippedSegments","startCC","canSkipDateRanges","DateRange","isValid","newFragments","_i2","mapPartIntersection","oldPart","newPart","adjustSliding","driftStartTime","driftStart","driftEndTime","driftEnd","oldParts","newParts","intersectionFn","_oldPart","_newPart","newFrags","oldFrags","_oldFrag","_newFrag","addSliding","lastSegmentDuration","_base_stream_controller__WEBPACK_IMPORTED_MODULE_1__","_is_supported__WEBPACK_IMPORTED_MODULE_2__","_events__WEBPACK_IMPORTED_MODULE_3__","_fragment_tracker__WEBPACK_IMPORTED_MODULE_5__","_loader_fragment__WEBPACK_IMPORTED_MODULE_7__","_demux_transmuxer_interface__WEBPACK_IMPORTED_MODULE_8__","_types_transmuxer__WEBPACK_IMPORTED_MODULE_9__","_gap_controller__WEBPACK_IMPORTED_MODULE_10__","_errors__WEBPACK_IMPORTED_MODULE_11__","StreamController","_BaseStreamController","audioCodecSwap","gapController","_forceStartLoad","fragPlaying","onvplaying","onvseeked","fragLastKbps","couldBacktrack","backtrackFragment","audioCodecSwitch","videoBuffer","onLevelLoading","onFragLoadEmergencyAborted","AUDIO_TRACK_SWITCHING","onAudioTrackSwitching","onBufferCreated","onBufferFlushed","onLevelsUpdated","doTickIdle","_levels$level","_this$media","checkBuffer","checkFragmentChanged","getMainFwdBufferInfo","lastDetails","_this$backtrackFragme","backtrackFrag","_this$media2","fragState","_loadBitrateTestFrag","fragOrPart","followingBufferedFrag","immediateLevelSwitch","abortCurrentFrag","fetchdelay","fragPlayingCurrent","bufferedFrag","nextBufferedFrag","maxStart","startPts","onMediaPlaying","onMediaSeeked","aac","heaac","changeTypeSupported","_curLevel$details","newLevelId","endCC","_frag$initSegment","accurateTimeOffset","initSegmentData","_getAudioCodec","_handleTransmuxComplete","fromAltAudio","trackId","mediaTrack","name","alternate","videoTrack","flushBuffer","bufferedInfo","swapAudioCodec","transmuxResult","_id3$samples","remuxResult","text","id3","_bufferInitSegment","FRAG_PARSING_INIT_SEGMENT","timescale","INIT_PTS_FOUND","firstKeyFrame","firstKeyFramePTS","backtrack","setElementaryStreamInfo","_startPTS","_endPTS","_startDTS","_endDTS","emittedID3","emittedText","FRAG_PARSING_USERDATA","ua","channelCount","fragCurrentLevel","LEVEL_SWITCHED","currentFrag","epocMs","AESCrypto","subtle","aesIV","_utils_typed_array__WEBPACK_IMPORTED_MODULE_0__","removePadding","array","outputBytes","paddingBytes","DataView","getUint8","sliceUint8","AESDecryptor","rcon","subMix","Uint32Array","invSubMix","sBox","invSBox","ksRows","keySize","keySchedule","invKeySchedule","initTable","uint8ArrayToUint32Array_","arrayBuffer","view","newArray","getUint32","subMix0","subMix1","subMix2","subMix3","invSubMix0","invSubMix1","invSubMix2","invSubMix3","x","xi","sx","x2","x4","x8","expandKey","keyBuffer","sameKey","ksRow","invKsRow","prev","sbox","networkToHostOrderSwap","word","inputArrayBuffer","t0","t1","t2","t3","s0","s1","s2","s3","inputWords0","inputWords1","inputWords2","inputWords3","nRounds","invSBOX","initVector","initVector0","initVector1","initVector2","initVector3","inputInt32","Int32Array","outputInt32","swapWord","_aes_crypto__WEBPACK_IMPORTED_MODULE_0__","_fast_aes_key__WEBPACK_IMPORTED_MODULE_1__","_aes_decryptor__WEBPACK_IMPORTED_MODULE_2__","_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_4__","_utils_typed_array__WEBPACK_IMPORTED_MODULE_5__","Decrypter","_temp","_ref$removePKCS7Paddi","removePKCS7Padding","logEnabled","softwareDecrypter","fastAesKey","remainderData","currentIV","currentResult","useSoftware","browserCrypto","crypto","webkitSubtle","isSync","reset","softwareDecrypt","decryptResult","webCryptoDecrypt","logOnce","currentChunk","getValidChunk","aesKey","onWebCryptoError","splitPoint","msg","FastAESKey","importKey","_base_audio_demuxer__WEBPACK_IMPORTED_MODULE_0__","_adts__WEBPACK_IMPORTED_MODULE_1__","_BaseAudioDemuxer","AACDemuxer","observer","resetInitSegment","trackDuration","_audioTrack","pid","sequenceNumber","segmentCodec","manifestCodec","inputTimeScale","probe","getID3Data","canParse","appendFrame","initTrackConfig","basePTS","frameIndex","missing","getAudioConfig","adtsObjectType","adtsExtensionSamplingIndex","adtsChannelConfig","adtsSamplingRates","adtsSamplingIndex","samplerate","isHeaderPattern","getHeaderLength","getFullFrameLength","canGetFrameLength","isHeader","headerLength","frameLength","newOffset","getFrameDuration","parseFrameHeader","unit","stamp","header","_length","subarray","_sample","_demux_id3__WEBPACK_IMPORTED_MODULE_1__","_types_demuxer__WEBPACK_IMPORTED_MODULE_2__","_dummy_demuxed_track__WEBPACK_IMPORTED_MODULE_3__","BaseAudioDemuxer","_id3Track","cachedData","lastPTS","resetTimeStamp","deaultTimestamp","resetContiguity","demux","timeOffset","lastDataIndex","id3Data","timestamp","getTimeStamp","initPTSFn","dts","partialData","dummyTrack","demuxSampleAes","keyData","ChunkCache","chunks","dataLength","chunk","concatUint8Arrays","ExpGolomb","bytesAvailable","bitsAvailable","loadWord","workingBytes","availableBytes","skipBits","count","skipBytes","readBits","size","bits","valu","skipLZ","leadingZeroCount","skipUEG","skipEG","readUEG","clz","readEG","readBoolean","readUByte","readUShort","readUInt","skipScalingList","lastScale","nextScale","readSPS","numRefFramesInPicOrderCntCycle","scalingListCount","frameCropLeftOffset","frameCropRightOffset","frameCropTopOffset","frameCropBottomOffset","profileIdc","chromaFormatIdc","picOrderCntType","picWidthInMbsMinus1","picHeightInMapUnitsMinus1","frameMbsOnlyFlag","ceil","readSliceType","decoder","isFooter","front","readSize","readTimeStamp","getFrameData","fromCharCode","frameData","decodeFrame","decodePrivFrame","decodeURLFrame","decodeTextFrame","owner","utf8ArrayToStr","privateData","description","timeStampFrame","pts33Bit","exitOnNull","getTextDecoder","decoded","decode","idx","substring","c","char2","char3","out","testables","TextDecoder","_mpegaudio__WEBPACK_IMPORTED_MODULE_3__","MP3Demuxer","_types_demuxer__WEBPACK_IMPORTED_MODULE_1__","_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_2__","emsgSchemePattern","MP4Demuxer","txtTrack","captionTrack","initData","parseInitSegment","_initData$video","_initData$audio","_id","_timescale","_codec","RemuxerTrackIdConfig","sampleDuration","findBox","videoSamples","segmentedData","segmentValidRange","remainder","valid","extractID3Track","parseSamples","emsgs","emsgInfo","parseEmsg","schemeIdUri","presentationTime","timeScale","presentationTimeDelta","eventDuration","chromeVersion","BitratesMap","SamplingRateMap","SamplesCoefficients","BytesInSlot","parseHeader","samplesPerFrame","sampleRate","mpegVersion","mpegLayer","bitRateIndex","sampleRateIndex","paddingBit","channelMode","bitRate","sampleCoefficient","bytesInSlot","match","_crypt_decrypter__WEBPACK_IMPORTED_MODULE_0__","_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_1__","SampleAesDecrypter","decryptBuffer","encryptedData","decryptAacSample","sampleIndex","callback","curUnit","encryptedBuffer","byteOffset","decryptedBuffer","decryptAacSamples","getAvcEncryptedData","decodedData","encryptedDataLen","Int8Array","outputPos","inputPos","getAvcDecryptedUnit","uint8DecryptedData","decryptAvcSample","unitIndex","discardEPB","decryptAvcSamples","curUnits","units","_webworkify_webpack__WEBPACK_IMPORTED_MODULE_0__","_demux_transmuxer__WEBPACK_IMPORTED_MODULE_2__","_errors__WEBPACK_IMPORTED_MODULE_4__","eventemitter3__WEBPACK_IMPORTED_MODULE_6__","isTypeSupported","TransmuxerInterface","onTransmuxComplete","onFlush","useWorker","worker","onwmsg","forwardMessage","ev","EventEmitter","typeSupported","mp4","mpeg","mp3","vendor","Worker","onWorkerMessage","onerror","filename","lineno","postMessage","cmd","objectURL","w","terminate","removeAllListeners","defaultInitPTS","_lastFrag$initSegment","transmuxing","lastFrag","discontinuity","trackSwitch","snDiff","partDiff","initSegmentChange","TransmuxState","TransmuxConfig","configureTransmuxer","ArrayBuffer","_transmuxResult","isPromise","async","handleTransmuxComplete","transmuxerError","_transmuxResult2","handleFlushResult","results","logType","configure","_demux_transmuxer__WEBPACK_IMPORTED_MODULE_0__","eventemitter3__WEBPACK_IMPORTED_MODULE_3__","TransmuxerWorker","parse","enableLogs","logFn","forwardWorkerLogs","emitTransmuxComplete","transferable","_transmuxResult$remux","addToTransferable","parsed","_crypt_decrypter__WEBPACK_IMPORTED_MODULE_2__","_demux_aacdemuxer__WEBPACK_IMPORTED_MODULE_3__","_demux_mp4demuxer__WEBPACK_IMPORTED_MODULE_4__","_demux_tsdemuxer__WEBPACK_IMPORTED_MODULE_5__","_demux_mp3demuxer__WEBPACK_IMPORTED_MODULE_6__","_remux_mp4_remuxer__WEBPACK_IMPORTED_MODULE_7__","_remux_passthrough_remuxer__WEBPACK_IMPORTED_MODULE_8__","_utils_logger__WEBPACK_IMPORTED_MODULE_9__","muxConfig","remux","Transmuxer","demuxer","remuxer","decryptionPromise","transmuxConfig","currentTransmuxState","uintData","defaultInitPts","encryptionType","getEncryptionType","getDecrypter","emptyResult","resetMuxers","needsProbing","resetInitialTimestamp","transmux","currentState","transmuxResults","emit","demuxResultOrPromise","demuxResult","flushRemux","_this$currentTransmux","resetNextTimestamp","transmuxSampleAes","transmuxUnencrypted","_demux","mux","Remuxer","Demuxer","Function","_adts__WEBPACK_IMPORTED_MODULE_0__","_mpegaudio__WEBPACK_IMPORTED_MODULE_1__","_exp_golomb__WEBPACK_IMPORTED_MODULE_2__","_sample_aes__WEBPACK_IMPORTED_MODULE_3__","_events__WEBPACK_IMPORTED_MODULE_4__","_utils_mp4_tools__WEBPACK_IMPORTED_MODULE_5__","_utils_logger__WEBPACK_IMPORTED_MODULE_6__","_errors__WEBPACK_IMPORTED_MODULE_7__","_types_demuxer__WEBPACK_IMPORTED_MODULE_8__","PACKET_LENGTH","createAVCSample","parsePID","parsePAT","parsePMT","isSampleAes","avc","tableEnd","parsePES","stream","pesLen","pesHdrLen","pesPts","pesDts","newData","splice","pesFlags","payloadStartOffset","pesData","dataLen","pushAccessUnit","avcSample","avcTrack","nbSamples","lastSample","TSDemuxer","sampleAes","pmtParsed","_duration","_pmtId","_avcTrack","_txtTrack","aacOverFlow","syncOffset","scanwindow","foundPat","pes","avcId","avcData","audioId","id3Id","audioData","unknownPID","pmtId","tsPacketErrors","stt","parseAVCPES","parseAACPES","parseMPEGPES","parseID3PES","parsedPIDs","extractRemainingSamples","last","parseAVCNALu","spsfound","audFound","sliceType","parseSEIMessageFromNALu","sps","codecarray","codecstring","h","pps","getLastNalUnit","_avcSample","lastUnit","overflow","naluState","lastState","lastUnitStart","lastUnitType","tmp","_unit","_lastUnit","_tmp","frameMissingBytes","sampleLength","frameOverflowBytes","frameDuration","id3Sample","webpackBootstrapFuncArr","ENTRY_MODULE","__webpack_module_cache__","__nested_webpack_require_497__","__webpack_require__","moduleId","cachedModule","exports","module","m","getter","__esModule","definition","prop","toStringTag","default","moduleNameReqExp","dependencyRegExp","quoteRegExp","getModuleDependencies","sources","queueName","retval","fnString","wrapperSignature","webpackRequireName","re","RegExp","exec","isNaN","hasValuesInQueues","hasValues","getWebpackString","requiredModules","entryModule","moduleString","join","options","main","modulesQueue","seenModules","moduleToCheck","pop","newModules","newModulesKeys","getRequiredModules","modules","blob","Blob","workerUrl","webkitURL","mozURL","msURL","url_toolkit__WEBPACK_IMPORTED_MODULE_0__","_loader_playlist_loader__WEBPACK_IMPORTED_MODULE_1__","_controller_id3_track_controller__WEBPACK_IMPORTED_MODULE_2__","_controller_latency_controller__WEBPACK_IMPORTED_MODULE_3__","_controller_level_controller__WEBPACK_IMPORTED_MODULE_4__","_controller_fragment_tracker__WEBPACK_IMPORTED_MODULE_5__","_loader_key_loader__WEBPACK_IMPORTED_MODULE_6__","_controller_stream_controller__WEBPACK_IMPORTED_MODULE_7__","_is_supported__WEBPACK_IMPORTED_MODULE_8__","_config__WEBPACK_IMPORTED_MODULE_10__","eventemitter3__WEBPACK_IMPORTED_MODULE_11__","_events__WEBPACK_IMPORTED_MODULE_12__","_errors__WEBPACK_IMPORTED_MODULE_13__","_types_level__WEBPACK_IMPORTED_MODULE_14__","Hls","coreComponents","networkControllers","_emitter","_autoLevelCapping","_maxHdcpLevel","latencyController","levelController","_media","DefaultConfig","ConfigAbrController","ConfigBufferController","ConfigCapLevelController","ConfigFpsController","playListLoader","id3TrackController","createController","AudioStreamControllerClass","SubtitleStreamControllerClass","isSupported","ControllerClass","components","controllerInstance","once","eventObject","listenerCount","DESTROYING","detachMedia","component","attachMedia","loadSource","loadedSource","loadingSource","buildAbsoluteURL","location","alwaysNormalize","controller","recoverMediaError","loadLevel","manualLevel","shouldStartCapping","newCapLevelToPlayerSize","hdcpLevel","currentProgramDateTime","audioTrackId","subtitleTrack","subtitleTrackId","subtitleDisplay","_utils_mediasource_helper__WEBPACK_IMPORTED_MODULE_0__","getSourceBuffer","SourceBuffer","WebKitSourceBuffer","sourceBufferValidAPI","_sourceBuffer$prototy","_utils_attr_list__WEBPACK_IMPORTED_MODULE_1__","dateRangeAttr","dateRangeWithSameId","_startDate","_endDate","_badValueForSameId","previousAttr","AttrList","PLANNED_DURATION","bool","_wrapNativeSuper","Class","_cache","Map","has","Wrapper","_construct","_getPrototypeOf","Parent","args","Reflect","construct","sham","Proxy","Boolean","valueOf","_isNativeReflectConstruct","instance","getPrototypeOf","MIN_CHUNK_SIZE","FragmentLoader","partLoadTimeout","_onProgress","LoadError","networkDetails","FragmentILoader","DefaultILoader","loaderContext","createLoaderContext","loaderConfig","timeout","maxRetry","retryDelay","maxRetryDelay","highWaterMark","onSuccess","response","resetLoader","resetIV","onAbort","onTimeout","onProgress","updateStatsFromPart","fragStats","partStats","partTotal","estTotalParts","estLoadedParts","estRemainingBytes","fragLoading","partLoading","responseType","headers","rangeStart","byteRangeStartOffset","byteRangeEndOffset","byteRangeStart","byteRangeEnd","fragmentLen","_Error","_len","params","_key","url_toolkit__WEBPACK_IMPORTED_MODULE_1__","_load_stats__WEBPACK_IMPORTED_MODULE_2__","_inheritsLoose","_createClass","BaseSegment","baseurl","_this$elementaryStrea","_byteRange","_url","setByteRange","byteRange","Fragment","_BaseSegment","_decryptdata","rawProgramDateTime","tagList","levelkeys","LoadStats","title","_proto2","setKeyFormat","keyFormat","getDecryptData","_this$loader","_this$keyLoader","NONE","_key2","identity","keyFormats","_this$_decryptdata","Part","_BaseSegment2","partAttrs","fragOffset","gap","enumeratedString","_fragment_loader__WEBPACK_IMPORTED_MODULE_1__","KeyLoader","keyUriToKeyInfo","keyInfo","mediaKeySessionContext","isCommonEncryption","createKeyLoadError","loadingFrag","selectKeySystemFormat","keySystemFormat","loadInternal","_keyInfo","_keyInfo2","errorMessage","_keyInfo$mediaKeySess","keyLoadPromise","keyStatus","loadKeyHTTP","loadKeyEME","keySessionContextPromise","loadKey","keySessionContext","Loader","loaderCallbacks","LevelDetails","baseUrl","availabilityDelay","misses","m3u8","version","canSkipUntil","preloadHint","partSnDiff","partIndexDiff","runTime","_this$partList","_this$fragments","_this$partList2","_this$partList3","_utils_keysystem_util__WEBPACK_IMPORTED_MODULE_0__","_utils_mediakeys_helper__WEBPACK_IMPORTED_MODULE_1__","_utils_numeric_encoding_utils__WEBPACK_IMPORTED_MODULE_4__","keyUriToKeyIdMap","LevelKey","format","formatversions","keyFormatVersions","keyId","pssh","clearKeyUriToKeyIdMap","KeySystemFormats","FAIRPLAY","WIDEVINE","PLAYREADY","CLEARKEY","segmentNumber","uint8View","createInitializationVector","keyBytes","convertDataUriToArrayBytes","PlayReadyKeySystemUUID","mp4pssh","keyBytesUtf16","Uint16Array","keyByteStr","xmlKeyBytes","DOMParser","parseFromString","getElementsByTagName","childNodes","nodeValue","getAttribute","keyIdArray","base64Decode","changeEndianness","keydata","padded","_keyId","val","MAX_SAFE_INTEGER","setUint32","_date_range__WEBPACK_IMPORTED_MODULE_2__","_fragment__WEBPACK_IMPORTED_MODULE_3__","_level_details__WEBPACK_IMPORTED_MODULE_4__","_level_key__WEBPACK_IMPORTED_MODULE_5__","_utils_attr_list__WEBPACK_IMPORTED_MODULE_6__","_utils_logger__WEBPACK_IMPORTED_MODULE_7__","_utils_codecs__WEBPACK_IMPORTED_MODULE_8__","MASTER_PLAYLIST_REGEX","MASTER_PLAYLIST_MEDIA_REGEX","LEVEL_PLAYLIST_REGEX_FAST","LEVEL_PLAYLIST_REGEX_SLOW","M3U8Parser","findGroup","mediaGroupId","group","convertAVC1ToAVCOTI","avcdata","parseMasterPlaylist","string","levelsWithKnownCodecs","hasSessionData","lastIndex","_level$unknownCodecs","decimalInteger","NAME","resolution","decimalResolution","setCodecs","unknownCodecs","sessionAttrs","keyTag","sessionKey","parseKey","parseMasterPlaylistMedia","medias","TYPE","instreamId","LANGUAGE","autoselect","forced","lang","groupCodec","assignCodec","parseLevelPlaylist","levelUrlId","currentSN","currentPart","discontinuityCounter","prevFrag","firstPdtIndex","createNextFrag","setFragLevelKeys","assignProgramDateTime","tag","value1","value2","toUpperCase","skipAttrs","mapAttrs","init","setInitSegment","serverControlAttrs","optionalFloat","partInfAttrs","previousFragmentPart","preloadHintAttrs","renditionReportAttrs","fragmentLength","firstFragment","lastSn","fragPrev","backfillProgramDateTimes","_keyAttrs$enumeratedS","_keyAttrs$enumeratedS2","keyAttrs","decryptmethod","decrypturi","decryptiv","hexadecimalInteger","decryptkeyformatversions","decryptkeyformat","IV","resolvedUri","isFinite","codecs","filtered","isCodecType","preferred","lastIndexOf","groupItem","codecProperty","codecValue","BYTERANGE","_m3u8_parser__WEBPACK_IMPORTED_MODULE_4__","_types_loader__WEBPACK_IMPORTED_MODULE_5__","getResponseUrl","PlaylistLoader","loaders","destroyInternalLoaders","AUDIO_TRACK_LOADING","onAudioTrackLoading","SUBTITLE_TRACK_LOADING","onSubtitleTrackLoading","createInternalLoader","PLoader","getInternalLoader","resetInternalLoader","contextType","MANIFEST","LEVEL","_context$deliveryDire","loadsuccess","loaderror","loadtimeout","handleTrackOrLevelPlaylist","handleMasterPlaylist","handleManifestParsingError","handleNetworkError","_M3U8Parser$parseMast","audioGroups","subtitleGroups","textCodec","captions","levelId","SUBTITLE","mapContextToLevelType","singleLevel","handlePlaylistLoaded","LEVEL_EMPTY_ERROR","MANIFEST_PARSING_ERROR","UNKNOWN","MANIFEST_LOAD_TIMEOUT","MANIFEST_LOAD_ERROR","AUDIO_TRACK_LOAD_TIMEOUT","AUDIO_TRACK_LOAD_ERROR","SUBTITLE_TRACK_LOAD_TIMEOUT","SUBTITLE_LOAD_ERROR","errorData","getCacheAge","AUDIO_TRACK_LOADED","SUBTITLE_TRACK_LOADED","AAC","getSilentFrame","UINT32_MAX","MP4","types","avc1","avcC","btrt","dinf","dref","esds","ftyp","hdlr","mdat","mdhd","mdia","mfhd","minf","moof","moov","mp4a","mvex","mvhd","pasp","sdtp","stbl","stco","stsc","stsd","stsz","stts","tfdt","tfhd","traf","trak","trun","trex","tkhd","vmhd","smhd","charCodeAt","videoHdlr","audioHdlr","HDLR_TYPES","STTS","STSC","STCO","STSZ","VMHD","SMHD","STSD","majorBrand","avc1Brand","minorVersion","FTYP","box","DINF","upperWordDuration","lowerWordDuration","baseMediaDecodeTime","boxes","flags","dependsOn","isDependedOn","hasRedundancy","avcc","hSpacing","vSpacing","configlen","sampleDependencyTable","upperWordBaseMediaDecodeTime","lowerWordBaseMediaDecodeTime","cts","arraylen","isLeading","paddingValue","isNonSync","degradPrio","movie","_aac_helper__WEBPACK_IMPORTED_MODULE_1__","_mp4_generator__WEBPACK_IMPORTED_MODULE_2__","_utils_timescale_conversion__WEBPACK_IMPORTED_MODULE_7__","safariWebkitVersion","MP4Remuxer","ISGenerated","_initPTS","_initDTS","nextAvcDts","nextAudioPts","videoSampleDuration","isAudioContiguous","isVideoContiguous","_result","defaultTimeStamp","getVideoStartPts","rolloverDetected","minPTS","normalizePts","audioTimeOffset","videoTimeOffset","hasAudio","hasVideo","enoughAudioSamples","enoughVideoSamples","generateIS","firstKeyFrameIndex","findKeyframeIndex","audiovideoTimestampDelta","remuxAudio","audioTrackLength","remuxVideo","flushTextTrackMetadataCueSamples","flushTextTrackUserdataCueSamples","initDTS","audioSamples","computePTSDTS","firstDTS","lastDTS","inputSamples","outputSamples","mp4SampleDuration","maxPTS","NEGATIVE_INFINITY","sortSamples","deltadts","deltapts","inputDuration","averageSampleDuration","foundHole","foundOverlap","toMsFromMpegTsClock","firstPTS","nbNalu","naluLen","nbUnits","sampleLen","mdatSize","MUX_ERROR","stretchedLastFrame","minDtsDelta","minPtsDelta","maxDtsDelta","maxPtsDelta","avcSampleUnits","mp4SampleLength","_j","_nbUnits","unitData","unitDataLen","ptsDelta","lastFrameDuration","gapTolerance","deltaToFrameEnd","compositionTimeOffset","Mp4Sample","_i3","nextDts","_pts","nextPts","nb","scaleFactor","inputSampleDuration","rawMPEG","alignedWithVideo","timeOffsetMpegTS","newStamp","fillFrame","_j2","_nbSamples","audioSample","_pts2","unitLen","remuxEmptyAudio","videoData","silentFrame","reference","isKeyframe","Mp4SampleFlags","_mp4_remuxer__WEBPACK_IMPORTED_MODULE_1__","_loader_fragment__WEBPACK_IMPORTED_MODULE_3__","getParsedTrackCodec","parsedCodec","PassThroughRemuxer","emitInitSegment","initTracks","generateInitSegment","patchEncyptionData","_this$initPTS","getStartDTS","getDuration","offsetStartDTS","initPtsNum","TaskLoop","_boundTick","_tickTimer","_tickInterval","_tickCallCount","hasInterval","hasNextTick","millis","v2","Yes","searchParams","newValue","DECIMAL_RESOLUTION_REGEX","ATTR_LIST_REGEX","parseAttrList","attrName","intValue","stringValue","hexadecimalIntegerAsNumber","defaultValue","list","comparisonFn","minIndex","maxIndex","currentIndex","currentElement","comparisonResult","_logger__WEBPACK_IMPORTED_MODULE_0__","noopBuffered","maxHoleDuration","vbuffered","diff","buffered2","buf2len","buf2end","bufferStartNext","bufferLen","bufferStart","sampleEntryCodesISO","a3ds","alac","alaw","dra1","dtsc","dtse","dtsh","enca","g719","g726","m4ae","mha1","mha2","mhm1","mhm2","mlpa","Opus","opus","samr","sawb","sawp","sevc","sqcp","ssmv","twos","ulaw","avc2","avc3","avc4","avcp","av01","drac","dva1","dvav","dvh1","dvhe","encv","hev1","hvc1","mjp2","mp4v","mvc1","mvc2","mvc3","mvc4","resv","rv60","s263","svc1","svc2","vp08","vp09","stpp","wvtt","typeCodes","_logger__WEBPACK_IMPORTED_MODULE_1__","_controller_level_helper__WEBPACK_IMPORTED_MODULE_2__","findFirstFragWithCC","firstFrag","shouldAlignOnDiscontinuities","findDiscontinuousReferenceFrag","prevDetails","curDetails","referenceIndex","prevFrags","curFrags","prevStartFrag","adjustFragmentStart","adjustSlidingStart","referenceFrag","alignDiscontinuities","alignPDT","lastPDT","newPDT","alignMediaPlaylistByPDT","refDetails","refFragments","refFrag","refPDT","targetPDT","_utils_ewma__WEBPACK_IMPORTED_MODULE_0__","EwmaBandWidthEstimator","slow","fast","defaultEstimate","defaultEstimate_","minWeight_","minDelayMs_","slow_","fast_","halfLife","getTotalWeight","durationMs","numBytes","durationS","bandwidthInBps","EWMA","estimate","weight","alpha_","estimate_","totalWeight_","adjAlpha","zeroFactor","_loader_load_stats__WEBPACK_IMPORTED_MODULE_1__","_demux_chunk_cache__WEBPACK_IMPORTED_MODULE_2__","fetch","AbortController","ReadableStream","Request","FetchLoader","fetchSetup","requestTimeout","request","callbacks","getRequest","abortInternal","ok","_this$callbacks","initParams","signal","credentials","Headers","getRequestParameters","isArrayBuffer","LENGTH","status","statusText","FetchError","loadProgressively","responseData","loaderResponse","chunkCache","reader","getReader","pump","read","done","hexDump","_numeric_encoding_utils__WEBPACK_IMPORTED_MODULE_0__","swap","to","cur","keyIdbytes","paddedkeyIdbytes","colonsplit","semicolonsplit","commasplit","isbase64","strToUtf8array","unescape","encodeURIComponent","noop","fakeLogger","exportedLogger","exportLoggerFunctions","debugConfig","functions","func","consolePrintFn","KeySystems","KeySystemIds","keySystemFormatToKeySystemDomain","keySystemIdToKeySystemDomain","systemId","keySystemDomainToKeySystemFormat","keySystem","getKeySystemsForConfig","keySystemsToAttempt","getSupportedMediaKeySystemConfigurations","audioCodecs","videoCodecs","initDataTypes","baseConfig","persistentState","distinctiveIdentifier","sessionTypes","sessionType","audioCapabilities","contentType","robustness","audioRobustness","encryptionScheme","audioEncryptionScheme","videoCapabilities","videoRobustness","videoEncryptionScheme","createMediaKeySystemConfigurations","WebKitMediaSource","_loader_fragment__WEBPACK_IMPORTED_MODULE_0__","_typed_array__WEBPACK_IMPORTED_MODULE_1__","_demux_id3__WEBPACK_IMPORTED_MODULE_2__","_hex__WEBPACK_IMPORTED_MODULE_4__","bin2str","readUint16","readUint32","readSint32","writeUint32","path","endbox","subresults","parseSegmentIndex","sidx","references","startByte","referencesCount","referenceInfo","referenceSize","subsegmentDuration","earliestPresentationTime","traks","_index","hdlrType","soun","vide","sampleEntries","encBoxes","isAudio","enc","sinf","tenc","parseSinf","tencKeyId","schm","scheme","fmp4","baseTime","rawDuration","videoDuration","audioDuration","trafs","trackDefault","tfhdFlags","truns","computeRawDurationFromSamples","sidxDuration","sidxs","dur","ref","sampleCount","upper","lower","segmentedRange","moofs","temp","seiSamples","isHEVCFlavor","moofOffset","defaultSampleDuration","defaultSampleSizePresent","defaultSampleSize","defaultSampleFlagsPresent","tfhdOffset","delimit","baseCodec","isHEVC","dataOffsetPresent","dataOffset","firstSampleFlagsPresent","sampleDurationPresent","sampleSizePresent","sampleSize","sampleFlagsPresent","sampleCompositionOffsetsPresent","compositionOffset","trunOffset","sampleOffset","ix","naluTotalSize","naluSize","isSEIMessage","naluHeader","naluType","unescapedData","headerSize","seiPtr","payloadType","payloadSize","endOfCaptions","leftOver","providerCode","userStructure","userDataType","firstByte","enabled","totalBytes","byteArray","uuidStrArray","_b","userDataBytes","uuid","userData","EPBPositions","newLength","sourceIndex","leftPresentationTime","rightPresentationTime","isSafeInteger","mp4Box","keyids","RangeError","kids","kidCount","k","dataSize","parsePssh","boxSize","dataSizeOrKidCount","base64ToBase64Url","base64encodedStr","strToBase64Encode","btoa","base64DecodeToStr","atob","base64Encode","base64UrlEncode","videoEl","Event","document","createEvent","initEvent","dispatchEvent","addCueToTrack","getCueById","textTrackCue","getCuesInRange","cuesFound","firstCueInRange","mid","getFirstCueIndexAfterTime","_cue","MPEG_TS_CLOCK_FREQ_HZ","toTimescaleFromBase","destScale","srcBase","toTimescaleFromScale","srcScale","toMpegTsClockFromTimescale","AGE_HEADER_LINE_REGEX","XhrLoader","retryTimeout","onreadystatechange","onprogress","xhr","XMLHttpRequest","open","setRequestHeader","readystatechange","loadprogress","send","responseText","responseURL","lengthComputable","getAllResponseHeaders","getResponseHeader","prefix","EE","addListener","emitter","evt","_events","_eventsCount","clearEvent","eventNames","events","names","handlers","ee","a1","a2","a3","a4","a5","removeListener","prefixed","URL_REGEX","FIRST_SEGMENT_REGEX","SLASH_DOT_REGEX","SLASH_DOT_DOT_REGEX","URLToolkit","baseURL","relativeURL","opts","trim","basePartsForNormalise","parseURL","normalizePath","buildURLFromParts","relativeParts","baseParts","netLoc","pathParts","builtParts","query","baseURLPath","newPath","parts","reverse"],"sourceRoot":""}