import { ErrorLike, MediaEngineHost, MediaPreloadType, MediaStreamType } from "../../core/types.js"; import { DrmSystemsConfig } from "../../core/drm.js"; import { WithMediaTracks } from "../../core/media-tracks/mixin.js"; import { HTMLVideoElementHost } from "../video-host/video-host.js"; import shaka from "shaka-player/dist/shaka-player.compiled-es2021"; import * as _$_videojs_utils_types0 from "@videojs/utils/types"; //#region src/dom/shaka/media.d.ts type Opaque = string | number | boolean | bigint | symbol | null | undefined | ArrayBufferView; /** * Every level optional. Shaka's own configuration type describes a fully * resolved configuration, while `configure()` merges whatever subset it is * handed into the current one. */ type DeepPartial = T extends Opaque | readonly any[] | ((...args: any[]) => any) ? T : { [Key in keyof T]?: DeepPartial }; /** Shaka Player's configuration, as `configure()` accepts it. */ type ShakaConfig = DeepPartial; /** Structured Shaka source: which source to play, plus how to play it. */ interface ShakaSource { /** * Manifest URL. Shaka plays DASH, HLS, and progressive files from the same * property. Mirrors the host's `src` property. */ src?: string | undefined; /** * MIME type of the source. Handed to Shaka as the type to parse `src` as, * which is what makes an extensionless manifest URL playable. */ type?: string | undefined; /** * License servers for protected content, keyed by EME key system id. * * Translated into the `drm.servers` and `drm.advanced` Shaka configures EME * from. Name every system you hold a license server for — which one is used * is the browser's choice. */ drm?: DrmSystemsConfig | undefined; /** Playback options, keyed by the engine that reads them. */ engine?: ShakaEngineConfig | undefined; } /** The engines a Shaka source can configure. */ interface ShakaEngineConfig { /** * Shaka Player's own configuration, passed through untouched. Replacing it * resets any previously applied configuration. A `drm.servers` of its own * replaces `source.drm` — an escape hatch for licensing against the parts of * Shaka's DRM configuration `source.drm` does not cover. */ shaka?: ShakaConfig | undefined; } interface ShakaMediaProps { src: string; source: ShakaSource | null; preload: MediaPreloadType; streamType: MediaStreamType; } declare const shakaMediaDefaultProps: ShakaMediaProps; declare const ShakaMediaHost: WithMediaTracks; declare class ShakaMediaBase extends ShakaMediaHost implements MediaEngineHost, Omit { #private; constructor(); attach(target: HTMLVideoElement): void; detach(): void; destroy(): void; /** * Underlying playback engine — the Shaka `Player` instance, or `null` when * the browser cannot run it. An advanced escape hatch for direct engine * access; normal playback is driven through this element's own properties * and methods. */ get engine(): shaka.Player | null; /** * The last playback failure Shaka could not recover from, or `null`. Shaka * loads asynchronously, so a manifest that cannot be played fails after `src` * was assigned rather than at the assignment; the `error` event is when to * read this. * * A Shaka failure says more about what went wrong than the media element's * own `error` does, so it wins while there is one; anything the element failed * on by itself still reads through. */ get error(): ErrorLike | null; get src(): string; /** Manifest URL. Setting it re-derives `source`, carrying its settings over. */ set src(value: string); /** * How much to fetch before playback is asked for, mirroring the media * element's own `preload`. Shaka has no split between "know the source" and * "buffer it", so this maps onto when and how `engine.load()` runs: * * - `'auto'` — load immediately with the configured buffering goals. * - `'metadata'` — load immediately, holding buffering to about a segment; * the configured goals come back on the first play intent. * - `'none'` / `''` — hold the load entirely until the first play intent. * * A play intent is a `play` event, a target that is already playing, or * `autoplay` — which the spec lets override `preload` for good reason: with * nothing fetched there is nothing whose readiness could ever fire it. * Widening (`none` → `auto`) takes effect immediately; narrowing after a * load began cannot un-fetch and leaves it alone. */ get preload(): MediaPreloadType; set preload(value: MediaPreloadType); /** * Structured source: what to play (`src`, an optional `type`) plus how to * play it (`drm`, `engine.shaka`). Replacing it re-derives `src`. * * Shaka takes configuration on a live player, so changing `engine.shaka` * re-applies it in place instead of recreating the engine. */ get source(): ShakaSource | null; set source(value: ShakaSource | null); } declare const ShakaMedia_base: typeof ShakaMediaBase & _$_videojs_utils_types0.Constructor<{ streamType: MediaStreamType; }> & _$_videojs_utils_types0.Constructor<{ readonly liveEdgeStart: number; readonly targetLiveWindow: number; }>; /** * @fires sourcechange - Fired when `source` changes, either directly or by resolving a new `src`. Read `source` for the new value. * @fires error - Fired when playback fails in a way Shaka could not recover from. Read `error` for the failure. * @fires streamtypechange - Fired when the detected stream type changes. Read `streamType` for the new value. * @fires targetlivewindowchange - Fired when the live window duration changes. Read `targetLiveWindow` for the new value. */ declare class ShakaMedia extends ShakaMedia_base {} //#endregion export { ShakaConfig, ShakaEngineConfig, ShakaMedia, ShakaMediaProps, ShakaSource, shaka, shakaMediaDefaultProps }; //# sourceMappingURL=media.d.ts.map