// @flow import React, { useEffect } from 'react'; import { getDisplayName } from '../../../../base/settings'; import { Avatar } from '../../../avatar'; import { Video } from '../../../media'; import { getLocalParticipant } from '../../../participants'; import { connect } from '../../../redux'; import { getLocalVideoTrack } from '../../../tracks'; declare var APP: Object; export type Props = { /** * Local participant id. */ _participantId: string, /** * Flag controlling whether the video should be flipped or not. */ flipVideo: boolean, /** * The name of the user that is about to join. */ name: string, /** * Flag signaling the visibility of camera preview. */ videoMuted: boolean, /** * The JitsiLocalTrack to display. */ videoTrack: ?Object, }; /** * Component showing the video preview and device status. * * @param {Props} props - The props of the component. * @returns {ReactElement} */ function Preview(props: Props) { const { _participantId, flipVideo, name, videoMuted, videoTrack } = props; const className = flipVideo ? 'flipVideoX' : ''; useEffect(() => { APP.API.notifyPrejoinVideoVisibilityChanged(Boolean(!videoMuted && videoTrack)); }, [ videoMuted, videoTrack ]); useEffect(() => { APP.API.notifyPrejoinLoaded(); return () => APP.API.notifyPrejoinVideoVisibilityChanged(false); }, []); return (