import React, {useContext} from 'react'; import {RenderModeType, RtcSurfaceView} from 'react-native-agora'; import styles from '../Style'; import PropsContext, {UidInterface} from '../Contexts/PropsContext'; import {StyleSheet, View} from 'react-native'; import ImageIcon from '../Controls/ImageIcon'; import Username from './Usernames'; // const LocalView = RtcLocalView.SurfaceView; // const RemoteView = RtcRemoteView.SurfaceView; interface MaxViewInterface { user: UidInterface; fallback?: React.ComponentType; } /** * MaxVideoView takes in a user and renders the video */ const MaxVideoView: React.FC = (props) => { const {styleProps, rtcProps} = useContext(PropsContext); const {maxViewStyles} = styleProps || {}; const Fallback = props.fallback; return ( {!rtcProps.disableRtm && } {props.user.uid === 'local' ? ( props.user.video ? ( ) : Fallback ? ( ) : ( ) ) : props.user.video ? ( <> ) : Fallback ? ( ) : ( )} ); }; const DefaultFallback = () => { const {styleProps} = useContext(PropsContext); const {videoPlaceholderContainer} = styleProps || {}; return ( ); }; const style = StyleSheet.create({ placeholderContainer: { flex: 1, backgroundColor: '#000', justifyContent: 'center', }, }); export default MaxVideoView;