Member Junction
    Preparing search index...

    What a meeting room UI drives: the connection, the local microphone, camera and screen share, the data channel, effects, devices, and the room's state and events. LiveKitRoomController is the LiveKit implementation; another implementation (a test fake, a simulated room) runs the same UI without a LiveKit server.

    interface ILiveKitRoomController {
        Events: LiveKitRoomEventBus;
        State: LiveKitRoomState;
        State$: Observable<LiveKitRoomState>;
        Status: LiveKitConnectionStatus;
        ChangeScreenShare(
            request?: DisplayCaptureSurface | DisplayCaptureOptions,
        ): Promise<void>;
        Connect(
            serverUrl: string,
            token: string,
            options?: LiveKitRoomConnectOptions,
        ): Promise<void>;
        Disconnect(userInitiated?: boolean): Promise<boolean>;
        Dispose(): void;
        GetActiveDeviceId(
            kind: "audioinput" | "videoinput" | "audiooutput",
        ): string | null;
        ListDevices(
            kind: "audioinput" | "videoinput" | "audiooutput",
        ): Promise<LiveKitDevice[]>;
        SendData(text: string, topic?: string): Promise<boolean>;
        SetBackgroundEffect(effect: LiveKitBackgroundEffect): Promise<boolean>;
        SetCameraEnabled(enabled: boolean): Promise<void>;
        SetMicrophoneEnabled(enabled: boolean): Promise<void>;
        SetNoiseFilterEnabled(enabled: boolean): Promise<boolean>;
        SetScreenShareEnabled(
            enabled: boolean,
            request?: DisplayCaptureSurface | DisplayCaptureOptions,
        ): Promise<void>;
        StartAudio(): Promise<void>;
        SwitchDevice(
            kind: "audioinput" | "videoinput" | "audiooutput",
            deviceId: string,
        ): Promise<void>;
        ToggleCamera(): Promise<boolean>;
        ToggleMicrophone(): Promise<boolean>;
        ToggleScreenShare(): Promise<boolean>;
    }

    Implemented by

    Index

    Properties

    The room's cancelable event bus (Before-events + notifications).

    The current room-state snapshot.

    State$: Observable<LiveKitRoomState>

    The room-state snapshot: the current value on subscribe, then every change.

    The current connection status.

    Methods

    • Joins the room and brings the local participant online with the requested media. Only a failed connection fails the join; a microphone or camera that fails to start is left off and reported as a device error.

      Parameters

      Returns Promise<void>

    • Leaves the room. Resolves false when a beforeDisconnect handler canceled it.

      Parameters

      • OptionaluserInitiated: boolean

      Returns Promise<boolean>

    • The device in use for a kind, or null when unknown or not connected.

      Parameters

      • kind: "audioinput" | "videoinput" | "audiooutput"

      Returns string | null

    • Sends a text message to the room on the data channel. Resolves true when the message went out, and false when it did not: no room, a beforeSendData handler canceled it, or the send failed (also raised as an error of kind data).

      Parameters

      • text: string
      • Optionaltopic: string

      Returns Promise<boolean>

    • Turns the local camera on or off.

      Parameters

      • enabled: boolean

      Returns Promise<void>

    • Turns the local microphone on or off.

      Parameters

      • enabled: boolean

      Returns Promise<void>

    • Turns the noise filter on or off; resolves false when it cannot be applied.

      Parameters

      • enabled: boolean

      Returns Promise<boolean>

    • Resumes audio playback after a browser autoplay block (call from a user gesture).

      Returns Promise<void>

    • Moves a kind to another device.

      Parameters

      • kind: "audioinput" | "videoinput" | "audiooutput"
      • deviceId: string

      Returns Promise<void>

    • Toggles the microphone and resolves the new state.

      Returns Promise<boolean>

    • Toggles screen sharing and resolves the new state.

      Returns Promise<boolean>