@revenuecat/purchases-ui-js
Version:
Web components for Paywalls. Powered by RevenueCat
26 lines (25 loc) • 1.2 kB
TypeScript
/**
* Decorative / background `<video>` autoplay helpers (Safari, WebKit, cold load).
* `Video.svelte` uses `applyInlineVideoPlaybackFlags`, `subscribeDecorativeVideoAutoplayAttempts`,
* and its own richer `play().catch(...)` handling.
*/
/** Sets `muted` and `playsInline` for autoplay-heavy inline video. */
export declare function applyInlineVideoPlaybackFlags(el: HTMLVideoElement, options: {
preferMuted: boolean;
mutedPlaybackOverride: boolean;
}): void;
/**
* One programmatic `play()`; on rejection while unmuted, force muted playback and retry once.
* Honors `cancelled()` and ignores detached elements before mutating reactive state.
*/
export declare function tryDecorativeAutoplayWithMuteFallback(el: HTMLVideoElement, context: {
cancelled: () => boolean;
preferMuted: boolean;
getMutedOverride: () => boolean;
setMutedOverride: (muted: boolean) => void;
}): void;
/**
* Registers `loadeddata` / `canplay` (when needed), microtasks, rAF, and `window` `load`
* retries for cold-start autoplay scheduling.
*/
export declare function subscribeDecorativeVideoAutoplayAttempts(el: HTMLVideoElement, tryPlay: () => void, isCancelled: () => boolean): () => void;