Function CardVideoDisplay

CardVideoDisplay - A React functional component that displays a video stream with configurable display options.

This component renders a video element from a provided MediaStream, allowing options such as mirroring the video, setting a background color, and controlling whether the video fills the display area.

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

function App() {
const mediaStream = new MediaStream(); // Example media stream

return (
<CardVideoDisplay
remoteProducerId="producer-123"
eventType="live"
forceFullDisplay={true}
videoStream={mediaStream}
backgroundColor="black"
doMirror={true}
/>
);
}

export default App;

Properties

propTypes?: WeakValidationMap<CardVideoDisplayOptions>

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<CardVideoDisplayOptions>

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'