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

    Class Room

    Room is the room object itself, reachable as room on what useRoom returns.

    Almost nothing here needs it. useRoom already exposes the room's state and its 33 methods directly, and the feature hooks — useTranscription, useTranslation, useWhiteboard, useFile, usePubSub, useRealtimeStore — wrap the rest with React state and the right lifecycle. Reach for this object only for the handful of members below, which no hook exposes.

    import { useRoom } from "@videosdk.live/react-native-sdk";

    const { room } = useRoom();

    // capture config in force — no hook exposes this
    const videoConfig = await room.getAppliedVideoConfig();
    Index
    e2eeEnabled: boolean
    • true when media for this room is end-to-end encrypted.

    • Reports what is actually happening, not merely that a key provider was set.

    id: string
    • Unique id of the room.
    localParticipant: Participant
    participants: Map<string, Participant>
    • Every remote Participant in the room, keyed by participant id. The local participant is in here too.
      • The camera capture config currently in force — {width, height, frameRate, facingMode, codec, applied}.

      • Resolves null until the camera has been opened at least once.

      • applied is false when a config is set but capture is not running — after disableCam(), say — so a caller can tell a configured-but-idle camera from a live one. codec is the negotiated codec, so a VP8 fallback shows up here rather than the codec that was requested.

      Returns Promise<
          {
              applied?: boolean;
              codec?: string;
              facingMode?: "front"
              | "back";
              frameRate?: number;
              height?: number;
              width?: number;
          },
      >

      const { room } = useRoom();

      const config = await room.getAppliedVideoConfig();
      if (config?.applied) console.log(config.width, config.height, config.codec);
      • Removes a listener added with on.

      Parameters

      • eventType: string

        The event to unsubscribe from.

      • listener: (data: any) => void

        The same function that was passed to on.

      Returns void

      • Subscribes to a room-level event.

      • Every event here is already surfaced as a callback on useRoom, which is the supported way to consume them. This exists for code that holds the room object outside a component.

      Parameters

      • eventType: string

        The event name, in the SDK's hyphenated form — "participant-joined", "room-left", "error" and so on.

      • listener: (data: any) => void

        Called when the event fires.

      Returns void

      • Caps the outgoing webcam stream at the simulcast rung quality names.

      • Accepts "low", "med" and "high", plus the explicit "s<spatial>t<temporal>" forms "s0t0" through "s2t2". Matching is case-insensitive, as it is for a participant's setQuality.

      • The sender is capped by spatial layer alone, so the t digit is accepted and then ignored: "s0t0" and "s0t2" behave identically.

      • Applies to the stream already being sent, not at produce time, and is ignored while the webcam is disabled — enable it first, then cap it.

      Parameters

      • quality: string

        One of the values above.

      Returns Promise<void>

      const { room } = useRoom();

      await room.setWebcamQuality("low");