VideoView

<VideoView stream={participant.stream} />

The VideoView component renders a <video> element within your application.

Properties

PropertyRequiredTypeDescription

stream

MediaStream

The stream

muted

boolean

The mute state of the video element. Defaults to false

mirror

boolean

When set to true, the video is mirrored. Defaults to false.

style

Object

Inline styles to be applied to the <video> element.

onResize

Function

Callback that is triggered when the video element is resized. Reports the video's height, width and stream.

VideoView also accepts any other React.VideoHTMLAttributes.

Usage

import { useLocalMedia, VideoView } from "@whereby.com/browser-sdk/react";

function SelfView() {
    const localMedia = useLocalMedia({ audio: false, video: true });

    const { localStream } = localMedia.state;

    return (
        <VideoView muted stream={localStream} />
    );
}

Last updated