import type { ViewProps } from "react-native"; export interface LibVlcPlayerViewRef { /** * Starts playback of the current player * * @returns A promise which resolves to `void` */ readonly play: () => Promise; /** * Pauses playback of the current player * * @returns A promise which resolves to `void` */ readonly pause: () => Promise; /** * Stops playback of the current player * * @returns A promise which resolves to `void` */ readonly stop: () => Promise; /** * Sets the time or position of the current player * * @param value - Must be `0` or greater * @param type - Defaults to time * * @returns A promise which resolves to `void` */ readonly seek: (value: number, type?: "time" | "position") => Promise; /** * Starts or stops recording the current media * * @param path - Must be a valid directory, or `undefined` to stop recording * * @returns A promise which resolves to `void` */ readonly record: (path?: string) => Promise; /** * Takes a snapshot of the current media * * @param path - Must be a valid directory * * @returns A promise which resolves to `void` */ readonly snapshot: (path: string) => Promise; /** * Posts an answer to a question dialog * * @param action - Which dialog action to perform * * @returns A promise which resolves to `void` */ readonly postAction: (action: 1 | 2) => Promise; /** * Posts a username and password to a login dialog * * @param username - Can't be empty * @param password - Can be empty * @param store - Whether to store the credentials * * @returns A promise which resolves to `void` */ readonly postLogin: (username: string, password?: string, store?: boolean) => Promise; /** * Dismisses the current dialog * * @returns A promise which resolves to `void` */ readonly dismiss: () => Promise; /** * Enters Picture-in-Picture (PiP) mode * * @note Config plugin has to be configured for PiP to work * * @returns A promise which resolves to `void` */ readonly startPictureInPicture: () => Promise; /** * Exits Picture-in-Picture (PiP) mode * * @platform ios * * @returns A promise which resolves to `void` */ readonly stopPictureInPicture: () => Promise; } export type LibVlcSource = string | number | null; export type LibVlcSlaveSource = string | number; export interface Slave { source: LibVlcSlaveSource; type: "audio" | "subtitle"; selected?: boolean; } export interface Tracks { audio?: number; video?: number; subtitle?: number; } export interface Delays { audio?: number; subtitle?: number; } export type VideoAspectRatio = `${number}:${number}` | number | undefined; /** * @hidden */ type NativeAspectRatioProps = | { aspectRatio: "auto"; fallbackRatio: VideoAspectRatio; } | { aspectRatio?: VideoAspectRatio; fallbackRatio?: never; }; type AspectRatioProps = | { /** * Sets the container aspect ratio. * * When set to auto, a fallback ratio is required * * @default undefined */ aspectRatio: "auto"; /** * Sets the fallback aspect ratio * * @default undefined */ fallbackRatio: VideoAspectRatio; } | { /** * Sets the container aspect ratio. * * When set to auto, a fallback ratio is required * * @default undefined */ aspectRatio?: VideoAspectRatio; /** * Sets the fallback aspect ratio * * @default undefined */ fallbackRatio?: never; }; export type VideoContentFit = "contain" | "cover" | "fill"; export type AudioMixingMode = "mixWithOthers" | "duckOthers" | "auto" | "doNotMix"; export interface NativeEventProps { target: number; timeStamp: number; } export interface NativeEvent { nativeEvent: T & NativeEventProps; } export interface Buffering { value: number; } export interface Error { message: string; } export interface Dialog { title: string; text: string; type: "error" | "login" | "question"; cancelText: string | null; action1Text: string | null; action2Text: string | null; } export interface Time { value: number; } export interface Position { value: number; } export interface MediaTrack { id: number; name: string; } export interface MediaTracks { audio: MediaTrack[]; video: MediaTrack[]; subtitle: MediaTrack[]; } export interface Recording { path: string | null; isRecording: boolean; } export interface Snapshot { path: string; } export interface Video { width: number; height: number; frameRate: number; bitrate: number; } export interface Media { length: number; seekable: boolean; } export interface Metadata { title: string | null; artist: string | null; album: string | null; artworkURL: string | null; } export interface MediaInfo { video: Video; media: Media; metadata: Metadata; } /** * @hidden */ type BufferingListener = (event: NativeEvent) => void; /** * @hidden */ type PlayingListener = () => void; /** * @hidden */ type PausedListener = () => void; /** * @hidden */ type StoppedListener = () => void; /** * @hidden */ type EncounteredErrorListener = (event: NativeEvent) => void; /** * @hidden */ type DialogDisplayListener = (event: NativeEvent) => void; /** * @hidden */ type TimeChangedListener = (event: NativeEvent