/** * Video addresses (#454): recognise YouTube and Vimeo links, and build the * page a reader is sent to (the QR code, the PDF link) and the player a * screen output embeds. */ import type { Resource, ResolvedVideoPlayerOptions, VideoSource } from '../types.js'; /** A YouTube or Vimeo video recognised from a link. */ export interface ParsedVideoUrl { source: Exclude; /** The video id: 11 characters on YouTube, digits on Vimeo. */ id: string; /** Vimeo's privacy hash of an unlisted video (`vimeo.com/123/abc`, * `player.vimeo.com/video/123?h=abc`). */ hash?: string; /** Start time in whole seconds (`t=90`, `t=1m30s`, `#t=90s`). */ start?: number; } /** Recognise a YouTube or Vimeo link: watch pages, short links, Shorts, * embeds (youtube-nocookie too), Vimeo channel, group and showcase pages * and unlisted links. A bare host-less id is not accepted. */ export declare function parseVideoUrl(input: string | undefined): ParsedVideoUrl | undefined; /** The page of a YouTube or Vimeo video, the address printed in its QR code * and linked from the PDF, starting at `start` seconds. */ export declare function videoWatchUrl(parsed: ParsedVideoUrl, start?: number): string; /** The address a reader of a printed page is sent to for a video resource: * the YouTube or Vimeo page, or the production address of a self-hosted * file (`video.url`). `undefined` when there is none (a file not * published yet, a link that is neither YouTube nor Vimeo is still * returned as written when it is an http(s) address). */ export declare function resourceVideoLink(resource: Resource): string | undefined; /** The `src` of the YouTube or Vimeo player for a video, with the player * options the platform honours: controls, autoplay (muted, as browsers * require), loop, start and end, privacy-enhanced mode (youtube-nocookie, * Vimeo `dnt`) and, on Vimeo, the speed and picture-in-picture buttons. * Download is never offered by the embedded players. */ export declare function videoEmbedUrl(parsed: ParsedVideoUrl, player: ResolvedVideoPlayerOptions, range?: { start?: number; end?: number; }): string; /** The `allow` attribute of a YouTube or Vimeo `