import { CloudflareMediaProps } from "./props.js"; //#region src/dom/cloudflare/source.d.ts /** * Cloudflare Stream engine options, spelled exactly as Cloudflare spells them * (https://developers.cloudflare.com/stream/viewing-videos/using-the-stream-player/). * They are serialized onto the embed URL verbatim, so what you write here is * what the player reads. The embed reads them once, when its URL is built, so * changing them after the iframe exists only takes effect on the next embed. * * Parameters the host owns are deliberately absent: `controls`, `autoplay`, * `loop`, `muted`, `preload`, and `poster` come from the props of the same name, * so configuring them here would give two ways to say one thing. The index * signature still carries anything not listed here, so undocumented knobs and * whatever Cloudflare adds next keep working. */ interface CloudflareEngineConfig extends Record { /** BCP 47 language of the text track to show by default (`'en'`, `'de'`). */ defaultTextTrack?: string; /** Any CSS color for the progress bar and other player accents. */ primaryColor?: string; /** Any CSS color for the letterbox bars around a video that does not fill the player. */ letterboxColor?: string; /** Where playback starts, in seconds or as a time string (`'5m30s'`). */ startTime?: number | string; /** VAST tag to play as a pre-roll ad. Reported through the `stream-ad*` events. */ 'ad-url'?: string; /** `referrerpolicy` for the embed iframe. Not a Cloudflare player parameter. */ referrerPolicy?: ReferrerPolicy; } /** Structured Cloudflare source: which source to play, plus how to play it. */ interface CloudflareSource { /** Cloudflare Stream URL, video UID, or signed token. Mirrors the host's `src` property. */ src?: string | undefined; /** Playback options, keyed by the engine that reads them. */ engine?: CloudflareSourceEngineConfig | undefined; } /** The engines a Cloudflare source can configure. */ interface CloudflareSourceEngineConfig { /** Cloudflare's own embed parameters, passed through untouched. */ cloudflare?: CloudflareEngineConfig | undefined; } /** Parsed pieces of a Cloudflare Stream source. */ interface ParsedCloudflareSource { /** Video UID, or the signed token standing in for one. */ id: string; /** Whether `id` is a signed token rather than a plain video UID. */ signed: boolean; /** * Per-customer embed origin (`https://customer-.cloudflarestream.com`) * when the source names one, otherwise null for the shared host. Signed and * access-controlled videos are only served from the customer origin, so it has * to survive parsing rather than being collapsed into the shared one. */ origin: string | null; } /** Extract a Cloudflare video UID from a raw UID, a signed token, or any recognized URL. */ declare function parseCloudflareVideoId(src: string): string | null; /** * Parse a Cloudflare Stream source string. Recognizes `videodelivery.net` and * `cloudflarestream.com` URLs (embed, iframe, manifest, and thumbnail paths all * carry the id in the same position), raw 32-character video UIDs, and signed * tokens, which stand in for the UID wherever it appears. */ declare function parseCloudflareSource(src: string): ParsedCloudflareSource | null; /** Build the iframe `src` URL for an initial Cloudflare Stream embed from the given props. */ declare function buildCloudflareIframeSrc(src: string, props?: Partial): string; //#endregion export { CloudflareEngineConfig, CloudflareSource, CloudflareSourceEngineConfig, ParsedCloudflareSource, buildCloudflareIframeSrc, parseCloudflareSource, parseCloudflareVideoId }; //# sourceMappingURL=source.d.ts.map