/** * @fileoverview Concrete loader for medias. */ import TinyMediaLoader from '../../TinyMediaLoader.mjs'; export type VideoLoaderOptions = { /** * - The media source URL. */ src?: string; /** * - Maximum time in milliseconds before the load is aborted. */ timeout?: number; /** * - The CORS mode applied to the media. */ crossOrigin?: string | null; /** * - Whether the media should autoplay. */ autoplay?: boolean; /** * - Whether the media should loop. */ loop?: boolean; /** * - Whether the media should be muted. */ muted?: boolean; /** * - Whether the media should display controls (default true). */ controls?: boolean; /** * - The preload strategy. */ preload?: 'none' | 'metadata' | 'auto'; /** * - An existing DOM element to adopt. */ element?: HTMLContentElement | null; /** * - Whether to render progressively during fetch (default true). */ progressive?: boolean; /** * - Whether an external `src` change triggers a reload. */ autoReload?: boolean; /** * - Whether to download the media through fetch for byte progress. */ stream?: boolean; /** * - Whether to perform a HEAD request to fetch HTTP headers before downloading. */ useHeadRequest?: boolean; /** * - The request body forwarded to the transport (ignored by `GET`/`HEAD`). */ body?: BodyInit; /** * - An optional shared memory cache. */ cache?: import('../../utils/TinyMediaCache.mjs').default | null; }; export type MediaEarlyDecoder = import('../../TinyMediaLoader.mjs').MediaEarlyDecoder; export type TypesToTry = Record; /** * Base class for media loaders that support complex content types (audio and video) * and optional Media Source Extensions (MSE) streaming. * @extends {TinyMediaLoader} * @template {HTMLVideoElement|HTMLAudioElement} HTMLContentElement * @template {'video'|'audio'} Tag * @beta */ declare class TinyContentLoader extends TinyMediaLoader { #private; /** * Initializes a content loader for a specific media tag and set of candidate MIME types. * @param {Tag} tag - The HTML tag name (e.g., 'video' or 'audio'). * @param {TypesToTry} typesToTry - The mapping of format keys to candidate MIME types. * @param {VideoLoaderOptions} [options] - The loader configuration. * @throws {TypeError} If `crossOrigin` is not a string or null. * @throws {TypeError} If `preload` is not a string. */ constructor(tag: Tag, typesToTry: TypesToTry, options?: VideoLoaderOptions); /** * The underlying media element managed by the loader. * @returns {HTMLContentElement|null} The element instance, or null before it is created. */ get media(): HTMLContentElement | null; /** * Indicates whether the loader downloads the media through fetch for byte-level progress. * @returns {boolean} `true` when streaming is enabled, otherwise `false`. */ get stream(): boolean; /** * Orchestrates the initial load of the media, wiring up DOM events and initiating * either a native load or a streamed fetch. * @override * @protected * @returns {Promise} A promise that resolves once the media is ready and playback can start. */ protected _startLoad(): Promise; /** * Extracts the metadata specific to content media (video/audio), such as * dimensions and duration, to be merged into the final metadata object. * @override * @protected * @returns {import('../../TinyMediaLoader.mjs').MediaMetadataDetails} The resolved metadata for the media. */ protected _getMetadataDetails(): import('../../TinyMediaLoader.mjs').MediaMetadataDetails; /** * Creates the appropriate HTML media element based on the configured tag. * @override * @protected * @returns {HTMLContentElement} A newly created HTMLAudioElement or HTMLVideoElement. */ protected _createElement(): HTMLContentElement; /** * Aborts the media load and cleans up any active MSE object URLs to release memory. * @override * @protected * @returns {void} */ protected _abort(): void; /** * Releases MSE resources, revokes object URLs, and resets the media element * to prevent memory leaks. * @override * @protected * @returns {void} This method does not return a value. */ protected _cleanup(): void; } export default TinyContentLoader; //# sourceMappingURL=TinyContentLoader.d.mts.map