import type { IManifest, IManifestMetadata } from "../../../manifest"; import type { IMediaSourceInterface } from "../../../mse"; import type { IContentInitializationData } from "../../../multithread_types"; import type { IRepresentationEstimator } from "../../adaptive"; import type { IManifestRefreshSettings } from "../../fetchers"; import { ManifestFetcher, SegmentFetcherCreator } from "../../fetchers"; import SegmentSinksStore from "../../segment_sinks"; import type { INeedsMediaSourceReloadPayload } from "../../stream"; import DecipherabilityFreezeDetector from "../common/DecipherabilityFreezeDetector"; import TrackChoiceSetter from "./track_choice_setter"; import WorkerTextDisplayerInterface from "./worker_text_displayer_interface"; export default class ContentPreparer { private _currentContent; private _currentMediaSourceCanceller; private _contentCanceller; /** @see constructor */ private _hasMseInWorker; /** @see constructor */ private _hasVideo; /** * @param {Object} capabilities * @param {boolean} capabilities.hasMseInWorker - If `true`, the current * environment has access to MediaSource API in a WebWorker context (so, * here). * If `false`, we have to go through the main thread to rely on all MSE API. * @param {boolean} capabilities.hasVideo - If `true`, we're playing on an * element which has video capabilities. * If `false`, we're only able to play audio, optionally with subtitles. * * Typically this boolean is `true` for `