React Native Api Reference
    Preparing search index...

    Class RoomProvider

    • RoomProvider is a Context Provider that initializes and manages the room lifecycle and exposes room state to all child components.

    • This provider wraps the core VideoSDK room logic using React Context, allowing any nested component to access room data and hooks.

    • To learn more about React Context Providers, refer to the official React documentation.

    <RoomProvider
    config={{
    roomId: "room-id",
    micEnabled: true,
    camEnabled: true,
    name: "Participant Name",
    participantId: "xyz",
    multiStream: true,
    mode: "SEND_AND_RECV", // "SEND_AND_RECV" || "SIGNALLING_ONLY"
    }}
    token={"token"}
    joinWithoutUserInteraction={true}
    ></RoomProvider>
    Index
    autoConsume?: boolean

    When set to false, you have to manually call consumeWebcamStreams and consumeMicStreams to consume the streams.

    true
    
    camEnabled?: boolean

    Enables webcam on join.

    true
    
    codecSwitchEnabled?: boolean

    Switch codec to VP8 when the user cant consume the codec then we goes to VP8 .

    true
    
    customCameraTrack?: CustomStreamTrack

    Custom camera video track to use as the camera input.

    If this is not provided, the SDK will automatically create and use a default camera video track. You can create a custom track using createCameraVideoTrack.

    customMicrophoneTrack?: CustomStreamTrack

    Custom microphone audio track to use as the microphone input.

    If this is not provided, the SDK will automatically create and use a default microphone audio track.You can create a custom track using createMicrophoneAudioTrack.

    defaultCamera?: "front" | "back"

    Specifies which camera the default webcam opens on.

    • front → front camera
    • back → rear camera

    A customCameraTrack keeps its own facingMode, and after changeCam() the webcam stays on the camera switched to.

    "front"
    
    dynaCast?: boolean

    Cap each participant's simulcast ladder to what the viewer actually needs. Turning this on also enables multiStream.

    false
    
    enableBatching?: boolean

    Batch signalling messages instead of sending each one as it is produced.

    true
    
    joinWithoutUserInteraction?: boolean

    Controls how the participant joins the room.

    • When set to true, the participant automatically joins the room as soon as the provider is mounted.
    • When set to false, the participant must explicitly call join() to enter the room.
    maxResolution?: "hd" | "sd"

    Maximum resolution for video publishing.

    "sd" opens the default camera at 960x540 instead of 1280x720, and makes setQuality ask for one simulcast layer lower: "high" gets the middle layer, "med" and "low" the lowest. A customCameraTrack keeps its own encoder config.

    "hd"
    
    metaData?: object

    Custom metadata associated with the participant.

    null
    
    micEnabled?: boolean

    Enables microphone on join.

    true
    
    mode?: "SEND_AND_RECV" | "SIGNALLING_ONLY" | "RECV_ONLY"

    Defines how media streams should behave.There are 3 types of Mode

    "SEND_AND_RECV"
    
    multiStream?: boolean

    Enables or disables multi-resolution streaming.

    true
    
    participantId?: string

    Unique participant identifier.

    a random 8-character string
    
    participantName?: string

    Display name of the participant.

    a random 6-character string
    
    preferredProtocol?: "UDP_ONLY" | "UDP_OVER_TCP" | "TCP_ONLY"

    Preferred network protocol for media transmission.

    Allowed Value:

    • UDP_OVER_TCP (default): Initially the server attempts to establish a connection using UDP, if that fails it automatically switches to TCP protocol.
    • UDP_ONLY: Force UDP protocol
    • TCP_ONLY: Force TCP protocol
    roomId: string
    • Unique Id of the room where that participant will be joining.
    • Please refer this documentation to create a room.
    signalingBaseUrl?: string

    If you want to use a proxy server with the VideoSDK, you can specify your baseURL here.

    Note

    If you intend to use a proxy server with the VideoSDK, priorly inform us at support@videosdk.live

    speakingLanguage?: string

    The language this participant speaks.

    Real-time translation uses it as the source language for this participant's speech, and it reaches other participants as participantLanguage on onTranslationText.

    It can only be set before the room is joined — there is no method to change it during the room.

    token: string

    Authentication token used to authorize the participant with VideoSDK.

    You can generate a token using one of the following methods:

    1. Temporary Token – Generate directly from the Dashboard API Keys.
    2. Server-generated Token – Generate a JWT on your backend and securely provide it to the client.
    translationLanguage?: string

    The language this participant receives translated speech in.

    When it is not set, this device receives no translated text even while translation is running for the room. It can be changed during the room with changeTranslationLanguage(), which affects only this device.

    Both language props take one of the codes listed under Supported Languages — a plain code such as "es", a regional variant such as "en-GB" or "pt-BR", a script variant such as "zh-Hant", or "multi". Nothing in the SDK validates the code: an unsupported one raises no error, the device simply receives no translated text.