import React from 'react'; import { StyleProp, ViewStyle, ImageStyle } from 'react-native'; import { Socket } from 'socket.io-client'; import { EventType, ShowAlert, CoHostResponsibility, Participant, AudioDecibels, MediaStream, CustomVideoCardType } from '../../@types/types'; /** * Parameters used by `VideoCard` to synchronize meeting state and permissions. * * @interface VideoCardParameters * * **Session Context:** * @property {Socket} socket Socket connection for media control events. * @property {string} roomName Active room identifier. * @property {CoHostResponsibility[]} coHostResponsibility Allowed co-host actions. * @property {ShowAlert} [showAlert] Optional alert dispatcher. * @property {string} coHost Current co-host. * @property {Participant[]} participants Roster for participant lookups. * @property {string} member Local member identifier. * @property {string} islevel Privilege level for the local user. * @property {AudioDecibels[]} audioDecibels Live audio intensity readings. * * **Helpers:** * @property {() => VideoCardParameters} getUpdatedAllParams Refresh callback to pull the latest values. * @property {[key: string]: any} [key: string] Additional parameters proxied through the card. */ export interface VideoCardParameters { socket: Socket; roomName: string; coHostResponsibility: CoHostResponsibility[]; showAlert?: ShowAlert; coHost: string; participants: Participant[]; member: string; islevel: string; audioDecibels: AudioDecibels[]; getUpdatedAllParams: () => VideoCardParameters; [key: string]: any; } /** * Options for rendering a `VideoCard`. * * @interface VideoCardOptions * * **Appearance:** * @property {StyleProp} [customStyle] Additional styling for the video card shell. * @property {StyleProp} [style] Optional wrapper styling for override containers. * @property {string} name Participant display name. * @property {string} [barColor='red'] Waveform color. * @property {string} [textColor='white'] Label color. * @property {string} [imageSource] Backup image when no stream is available. * @property {boolean} [roundedImage=false] Rounds fallback image corners. * @property {StyleProp} [imageStyle] Additional image styling. * @property {string} [backgroundColor='#2c678f'] Background fill color. * * **Video Source:** * @property {string} remoteProducerId Identifier for the remote stream owner. * @property {EventType} eventType Current event type (meeting, webinar, etc.). * @property {boolean} forceFullDisplay Forces video to fill the card. * @property {MediaStream | null} videoStream Media stream to render. * @property {boolean} [doMirror=false] Mirrors the video for self-views. * * **Controls & Info:** * @property {boolean} [showControls=true] Shows default control overlay. * @property {boolean} [showInfo=true] Shows participant info overlay. * @property {React.ReactNode} [videoInfoComponent] Custom info overlay content. * @property {React.ReactNode} [videoControlsComponent] Custom control overlay content. * @property {'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight'} [controlsPosition='topLeft'] Control overlay anchor. * @property {'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight'} [infoPosition='topRight'] Info overlay anchor. * * **Behaviour:** * @property {Participant} participant Participant metadata for controls. * @property {AudioDecibels[]} [audioDecibels] Collection of audio decibels for waveform. * @property {VideoCardParameters} parameters Shared meeting parameter bundle. * @property {CustomVideoCardType} [customVideoCard] Override for the card body layout. * * **Advanced Render Overrides:** * @property {(options: { defaultContent: JSX.Element; dimensions: { width: number; height: number } }) => JSX.Element} [renderContent] * Custom renderer for card internals. * @property {(options: { defaultContainer: JSX.Element; dimensions: { width: number; height: number } }) => JSX.Element} [renderContainer] * Custom renderer for the container wrapper. */ export interface VideoCardOptions { customStyle?: StyleProp; name: string; barColor?: string; textColor?: string; imageSource?: string; roundedImage?: boolean; imageStyle?: StyleProp; remoteProducerId: string; eventType: EventType; forceFullDisplay: boolean; videoStream: MediaStream | null; showControls?: boolean; showInfo?: boolean; videoInfoComponent?: React.ReactNode; videoControlsComponent?: React.ReactNode; controlsPosition?: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight'; infoPosition?: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight'; participant: Participant; backgroundColor?: string; audioDecibels?: AudioDecibels[]; doMirror?: boolean; parameters: VideoCardParameters; customVideoCard?: CustomVideoCardType; style?: StyleProp; renderContent?: (options: { defaultContent: JSX.Element; dimensions: { width: number; height: number; }; }) => JSX.Element; renderContainer?: (options: { defaultContainer: JSX.Element; dimensions: { width: number; height: number; }; }) => JSX.Element; } export type VideoCardType = (options: VideoCardOptions) => JSX.Element; /** * VideoCard renders participant video with optional overlays for controls, info, and audio waveforms. * It integrates with `controlMedia` to enforce host actions and offers override hooks for bespoke layouts. * * ### Key Features * - Streams video via `CardVideoDisplay`, falling back to initials or an image. * - Provides animated waveform tied to decibel telemetry when enabled. * - Offers customizable overlays for participant info and media controls. * - Supports mirrored self-view and force-fill presentations. * * ### Accessibility * - Controls expose iconography and can be wrapped in accessible touch targets. * - Text overlays default to high-contrast color schemes. * * @param {VideoCardOptions} props Video card configuration. * @returns {JSX.Element} Rendered video card. * * @example Default usage with host controls. * ```tsx * * ``` * * @example Custom content override. * ```tsx * ( * * {defaultContent} * * )} * /> * ``` */ declare const VideoCard: React.FC; export default VideoCard;