Function FlexibleVideo

FlexibleVideo component renders a flexible grid of video components with optional screenboard overlay and annotation support.

This component organizes video components in a grid format with customizable dimensions, and includes options to overlay a screenboard component, apply annotations, and manage aspect ratios.

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

function App() {
const componentsToRender = [
<VideoComponent1 />,
<VideoComponent2 />,
<VideoComponent3 />,
<VideoComponent4 />,
<VideoComponent5 />,
<VideoComponent6 />,
];

return (
<FlexibleVideo
customWidth={100}
customHeight={100}
rows={2}
columns={3}
componentsToRender={componentsToRender}
showAspect={true}
backgroundColor="white"
Screenboard={<ScreenboardComponent />}
annotateScreenStream={true}
localStreamScreen={localStreamStream}
/>
);
}

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'