import { MediaContentData, MediaResolution } from "../../../core/types.js"; import { DrmSystemsConfig } from "../../../core/drm.js"; //#region src/dom/mux/source/source.d.ts declare const MUX_VIDEO_DOMAIN = "mux.com"; /** Mux's rendition-height shorthand. Alias of {@link MediaResolution}. */ type MuxResolution = MediaResolution; type MuxRenditionOrder = 'desc'; type MuxImageExt = 'webp' | 'jpg' | 'png'; type MuxPosterFitMode = 'preserve' | 'stretch' | 'crop' | 'smartcrop' | 'pad'; /** * Playback modifiers appended to the stream URL as `snake_case` query params * (e.g. `assetStartTime` → `asset_start_time`). A signed playback `token` * replaces every other param — they must be baked into the signing token. */ interface MuxPlaybackParams { token?: string | undefined; /** Maximum resolution of renditions included in the manifest. */ maxResolution?: MuxResolution | undefined; /** Minimum resolution of renditions included in the manifest. */ minResolution?: MuxResolution | undefined; /** Logic to order renditions in the HLS manifest. */ renditionOrder?: MuxRenditionOrder | undefined; /** Start time for instant-clipping assets, as an epoch integer compared to the stream's program date time. */ programStartTime?: number | undefined; /** End time for instant-clipping assets, as an epoch integer compared to the stream's program date time. */ programEndTime?: number | undefined; /** Relative start time of the asset (in seconds) when using the instant clipping feature. */ assetStartTime?: number | undefined; /** Relative end time of the asset (in seconds) when using the instant clipping feature. */ assetEndTime?: number | undefined; /** Include HLS redundant streams in the manifest. */ redundantStreams?: boolean | undefined; /** Add support for timeline hover previews on Roku devices. */ rokuTrickPlay?: boolean | undefined; /** Default subtitles/captions language (BCP 47 compliant language code). */ defaultSubtitlesLang?: string | undefined; /** Omit `EXT-X-PROGRAM-DATE-TIME` tags from HLS manifests for assets from live streams. */ excludePdt?: boolean | undefined; [param: string]: string | number | boolean | undefined; } /** * Modifiers for the poster still, appended to the image URL as `snake_case` * query params. Mux serves it from its `thumbnail` image endpoint. */ interface MuxPosterParams { token?: string | undefined; /** Image format used in the URL path (`thumbnail.`). Defaults to `webp`. */ ext?: MuxImageExt | undefined; /** Video time (in seconds) the image is pulled from. Defaults to the middle of the video. */ time?: number | undefined; /** Width of the image (in pixels). Defaults to the width of the original video. */ width?: number | undefined; /** Height of the image (in pixels). Defaults to the height of the original video. */ height?: number | undefined; /** Rotate the image clockwise by the given number of degrees. */ rotate?: number | undefined; /** How to fit the image within the specified width + height. */ fitMode?: MuxPosterFitMode | undefined; /** Flip the image top-bottom after performing all other transformations. */ flipV?: boolean | undefined; /** Flip the image left-right after performing all other transformations. */ flipH?: boolean | undefined; /** Poster time for instant-clipping assets, as an epoch integer compared to the stream's program date time. */ programTime?: number | undefined; /** Pull the latest frame from an ongoing live stream. */ latest?: boolean | undefined; [param: string]: string | number | boolean | undefined; } interface MuxStoryboardParams { token?: string | undefined; /** Image format of the storyboard tiles referenced by the VTT. Defaults to `webp`. */ format?: MuxImageExt | undefined; [param: string]: string | number | undefined; } /** * Mux's DRM authoring input: a license token, in place of the license servers * `source.drm` normally names. Servers named outright alongside it still win, * key by key, for content Mux does not license. */ interface MuxDrmParams extends DrmSystemsConfig { /** * DRM license token: a JWT signed for the playback ID with the DRM (`d`) * audience. Mux derives every license server URL from it, so it is the only * thing a caller supplies. DRM playback is always signed, so a matching * `playback.token` is required alongside it. */ token?: string | undefined; } /** * What identifies a Mux stream and modifies it, independent of what plays it. * `playbackId` and `customDomain` identify the stream and derive the URL; `src` * is a fallback for playing a non-Mux URL. * * Each Mux Media extends this with whatever its own engine takes — see * `MuxSource` for the hls.js-backed one. */ interface MuxSourceBase { /** Manifest URL. Derived from `playbackId` when there is one. */ src?: string | undefined; playbackId?: string | undefined; customDomain?: string | undefined; playback?: MuxPlaybackParams | undefined; poster?: MuxPosterParams | undefined; storyboard?: MuxStoryboardParams | undefined; /** License servers keyed by key system, or a Mux license `token` to derive them from. */ drm?: MuxDrmParams | undefined; } /** * Serialize params to a query string (`?a=1&b=2`), mapping camelCase keys to * `snake_case` and skipping nullish values. A `token` replaces every other * param — signed URLs bake all modifiers into the token itself. */ declare function createMuxQuery(params?: Record): string; /** Build the Mux HLS stream URL for a source. */ declare function createMuxVideoURL(source?: MuxSourceBase | null): string | undefined; /** * Parse a Mux stream URL (`https://stream./.m3u8?...`) * into a `MuxSourceBase`, mapping `snake_case` query params back to camelCase * playback params. Returns `undefined` for non-Mux URLs. */ declare function parseMuxVideoURL(src: string): MuxSourceBase | undefined; /** * Image URLs a Mux source describes rather than plays, as every Mux Media * exposes them through `contentData`. A key is absent when its URL can't be * built — no playback ID, or signed playback without a matching image token. * * Names the two keys a Mux source actually derives. The index signature comes * from `MediaContentData`, which the shared `contentData` capability is typed * as, so it can't be closed off here — extending it is what keeps this * assignable to that contract. */ interface MuxContentData extends MediaContentData { readonly poster?: string; readonly storyboard?: string; } /** * Build the poster image URL a source describes. Read through `MuxMedia`'s * `contentData`. * * @internal */ declare function createMuxPosterURL(source?: MuxSourceBase | null): string | undefined; /** * Build the storyboard (thumbnail sprite) VTT URL a source describes. Read * through `MuxMedia`'s `contentData`. * * @internal */ declare function createMuxStoryboardURL(source?: MuxSourceBase | null): string | undefined; type MuxJWT = { sub: string; aud: 'v' | 't' | 'g' | 's' | 'd'; exp: number; }; //#endregion export { MUX_VIDEO_DOMAIN, MuxContentData, MuxDrmParams, MuxImageExt, MuxJWT, MuxPlaybackParams, MuxPosterFitMode, MuxPosterParams, MuxRenditionOrder, MuxResolution, MuxSourceBase, MuxStoryboardParams, createMuxPosterURL, createMuxQuery, createMuxStoryboardURL, createMuxVideoURL, parseMuxVideoURL }; //# sourceMappingURL=source.d.ts.map