React Native Api Reference - v2.0.0
    Preparing search index...

    Class MediaStream

    MediaStream is the container the track factories resolve, and the value RTCView renders.

    It is shaped like the web SDK's MediaStream — toURL() renders it, getVideoTracks() lists it — but it addresses a native device rather than holding media itself.

    import { RTCView, useParticipant } from "@videosdk.live/react-native-sdk";

    function ParticipantView({ participantId }) {
    const { webcamStream, webcamOn } = useParticipant(participantId);

    if (!webcamOn || !webcamStream) return null;

    return (
    <RTCView
    streamURL={new MediaStream([webcamStream.track]).toURL()}
    objectFit="cover"
    style={{ flex: 1 }}
    />
    );
    }
    Index
    active: boolean
    • false once the stream has been released.
    id: string
    • Id of the stream, or null for a stream built from a track that opened no device.
      • Releases the native device behind the stream. Idempotent, and a no-op for a stream the SDK owns.

      Returns Promise<void>

      • Produces the videosdk://… token that RTCView's streamURL prop takes.

      • Resolves null when the stream addresses no native track, so guard before rendering.

      Returns string