FlexibleVideo is a React Native component that renders a flexible video grid with optional screenboard overlay and annotation capabilities.

This component arranges components in a grid layout with specified rows and columns. It supports custom item dimensions, optional screenboard overlay, and video stream annotation.

import React from 'react';
import { FlexibleVideo } from 'mediasfu-reactnative';

function App() {
const videoComponents = [
<RTCView streamURL="stream1" />,
<RTCView streamURL="stream2" />,
];

return (
<FlexibleVideo
customWidth={200}
customHeight={150}
rows={2}
columns={2}
componentsToRender={videoComponents}
showAspect={true}
backgroundColor="black"
Screenboard={<Text>Overlay Component</Text>}
annotateScreenStream={true}
localStreamScreen={myLocalStream}
/>
);
}

export default App;

Properties

propTypes?: WeakValidationMap<FlexibleVideoOptions>

Used to declare the types of the props accepted by the component. These types will be checked during rendering and in development only.

We recommend using TypeScript instead of checking prop types at runtime.

contextTypes?: ValidationMap<any>

Lets you specify which legacy context is consumed by this component.

defaultProps?: Partial<FlexibleVideoOptions>

Used to define default values for the props accepted by the component.

type Props = { name?: string }

const MyComponent: FC<Props> = (props) => {
return <div>{props.name}</div>
}

MyComponent.defaultProps = {
name: 'John Doe'
}
displayName?: string

Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.


const MyComponent: FC = () => {
return <div>Hello!</div>
}

MyComponent.displayName = 'MyAwesomeComponent'