Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 1.48 KB

File metadata and controls

29 lines (19 loc) · 1.48 KB

VideoView

<VideoView stream={participant.stream} />

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

Properties

PropertyRequiredTypeDescription
streamMediaStreamThe stream
mutedbooleanThe mute state of the video element. Defaults to false
mirrorbooleanWhen set to true, the video is mirrored. Defaults to false.
styleObjectInline styles to be applied to the <video> element.
onResizeFunctionCallback 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} />
    );
}