Function CardVideoDisplay

CardVideoDisplay displays a video stream within a card layout, with support for customizable styling and mirroring.

This component uses RTCView to render a video stream with options to mirror the video, set full display, and apply platform-specific styles.

import React from 'react';
import { CardVideoDisplay } from 'mediasfu-reactnative';
import { MediaStream } from 'mediasfu-reactnative/dist/types/src/@types/types';

function App() {
const videoStream: MediaStream = getVideoStream(); // Assume a MediaStream object is available

return (
<CardVideoDisplay
remoteProducerId="producer123"
eventType="meeting"
forceFullDisplay={true}
videoStream={videoStream}
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'