The FFCRtcVideoRoom class provides an interface for managing and interacting with a WebRTC video room. It extends EventEmitter to emit various events related to room state, participants, tracks, and more.

Hierarchy

  • TypedEventEmitter<FFCRtcVideoRoomEventCallbacks, this>
    • FFCRtcVideoRoom

Constructors

Accessors

  • get canPlaybackAudio(): boolean

    Checks if audio playback is allowed in the room.

    Returns boolean

    true if audio playback is allowed, otherwise false.

  • get canPlaybackVideo(): boolean

    Checks if video playback is allowed in the room.

    Returns boolean

    true if video playback is allowed, otherwise false.

  • get isE2EEEnabled(): boolean

    Checks if end-to-end encryption (E2EE) is enabled.

    Returns boolean

    true if E2EE is enabled, otherwise false.

  • get isRecording(): boolean

    Checks if the room is currently recording.

    Returns boolean

    true if the room is recording, otherwise false.

  • get metadata(): undefined | string

    Gets the metadata associated with the room.

    Returns undefined | string

    The room metadata as a string, or undefined if not set.

  • get numParticipants(): number

    Gets the number of participants in the room.

    Returns number

    The number of participants.

  • get numPublishers(): number

    Gets the number of publishers in the room.

    Returns number

    The number of publishers.

  • get options(): FFCInternalRtcVideoRoomOptions

    Gets the options used to configure the room.

    Returns FFCInternalRtcVideoRoomOptions

    The room options as FFCInternalRtcVideoRoomOptions.

Methods

  • Connects to the room.

    Parameters

    • url: string

      The URL of the room's signaling server.

    • token: string

      The token for authenticating the connection.

    • Optionalopts: FFCRtcVideoRoomConnectOptions

      Optional connection options.

    Returns Promise<void>

    A promise that resolves when the connection is established.

  • Disconnects from the room.

    Parameters

    • stopTracks: boolean = true

      Whether to stop all tracks when disconnecting.

    Returns Promise<void>

    A promise that resolves when the disconnection is complete.

  • Gets the active device for a specific media kind.

    Parameters

    • kind: MediaDeviceKind

      The type of media device (e.g., "audioinput").

    Returns undefined | string

    The device ID of the active device, or undefined if not set.

  • Gets a participant by their identity.

    Parameters

    • idenity: string

    Returns undefined | FFCParticipant

    The participant as an FFCParticipant, or undefined if not found.

  • Gets the room's SID (Session Identifier).

    Returns Promise<string>

    A promise that resolves to the room's SID.

  • Prepares the connection to the room.

    Parameters

    • url: string

      The URL of the room's signaling server.

    • Optionaltoken: string

      The token for authenticating the connection.

    Returns Promise<void>

    A promise that resolves when the connection is prepared.

  • Starts audio playback in the room.

    Returns Promise<void>

    A promise that resolves when audio playback starts.

  • Starts video playback in the room.

    Returns Promise<void>

    A promise that resolves when video playback starts.

  • Switches the active device for a specific media kind.

    Parameters

    • kind: MediaDeviceKind

      The type of media device (e.g., "audioinput").

    • deviceId: string

      The ID of the device to switch to.

    • exact: boolean = false

      Whether to match the device ID exactly.

    Returns Promise<boolean>

    A promise that resolves to true if the device was switched successfully, otherwise false.

  • Retrieves the local media devices available on the system.

    Parameters

    Returns Promise<MediaDeviceInfo[]>

    A promise that resolves to an array of MediaDeviceInfo objects.