UNPKG

@interactive-video-labs/svelte

Version:

Thin Svelte wrapper for the @interactive-video-labs/core engine. Enables cue-based interactive video playback in Svelte applications.

49 lines 1.6 kB
import { PlayerConfig, CuePoint, Translations, AnalyticsEvent, AnalyticsPayload } from '@interactive-video-labs/core'; /** * Props for the InteractiveVideo component. */ export interface InteractiveVideoProps extends Omit<PlayerConfig, 'videoUrl' | 'cues' | 'translations' | 'targetElementId'> { /** * The URL of the video to be loaded. */ videoUrl: string; /** * Callback function for analytics events. * @param event The name of the event. * @param payload The data associated with the event. */ onAnalyticsEvent?: (event: AnalyticsEvent, payload?: AnalyticsPayload) => void; /** * An array of cue points for interactive events. */ cues?: CuePoint[]; /** * An object containing translations for the player. */ translations?: Translations; /** * Whether the video should start playing automatically. */ autoplay?: boolean; /** * Whether the video should loop. */ loop?: boolean; /** * The locale to be used for the player. */ locale?: string; /** * The ID of the target HTML element where the player will be mounted. */ targetElementId?: string; } /** * A Svelte component that wraps the IVLabsPlayer to provide interactive video capabilities. * It handles the lifecycle of the player, including initialization, updates, and destruction. */ export default function InteractiveVideo(node: HTMLElement, props: InteractiveVideoProps): { update(newProps: InteractiveVideoProps): void; destroy(): void; }; //# sourceMappingURL=index.d.ts.map