Client to access Room APIs

Hierarchy

  • default
    • RoomServiceClient

Constructors

Methods

  • Creates a new room. Explicit room creation is not required, since rooms will be automatically created when the first participant joins. This method can be used to customize room settings.

    Parameters

    Returns Promise<Room>

  • Get information on a specific participant, including the tracks that participant has published

    Parameters

    • room: string

      name of the room

    • identity: string

      identity of the participant to return

    Returns Promise<ParticipantInfo>

  • List participants in a room

    Parameters

    • room: string

      name of the room

    Returns Promise<ParticipantInfo[]>

  • List active rooms

    Parameters

    • Optional names: string[]

      when undefined or empty, list all rooms. otherwise returns rooms with matching names

    Returns Promise<Room[]>

  • Mutes a track that the participant has published.

    Parameters

    • room: string
    • identity: string
    • trackSid: string

      sid of the track to be muted

    • muted: boolean

      true to mute, false to unmute

    Returns Promise<TrackInfo>

  • Removes a participant in the room. This will disconnect the participant and will emit a Disconnected event for that participant. Even after being removed, the participant can still re-join the room.

    Parameters

    • room: string
    • identity: string

    Returns Promise<void>

  • Sends data message to participants in the room

    Parameters

    • room: string
    • data: Uint8Array

      opaque payload to send

    • kind: DataPacket_Kind

      delivery reliability

    • options: SendDataOptions

      optionally specify a topic and destinationSids (when destinationSids is empty, message is sent to everyone)

    Returns Promise<void>

  • Sends data message to participants in the room

    Parameters

    • room: string
    • data: Uint8Array

      opaque payload to send

    • kind: DataPacket_Kind

      delivery reliability

    • Optional destinationSids: string[]

      optional. when empty, message is sent to everyone

    Returns Promise<void>

    Deprecated

    use sendData(room, data, kind, options) instead

  • Updates a participant's metadata or permissions

    Parameters

    • room: string
    • identity: string
    • Optional metadata: string

      optional, metadata to update

    • Optional permission: Partial<ParticipantPermission>

      optional, new permissions to assign to participant

    • Optional name: string

      optional, new name for participant

    Returns Promise<ParticipantInfo>

  • Update metadata of a room

    Parameters

    • room: string

      name of the room

    • metadata: string

      the new metadata for the room

    Returns Promise<Room>

  • Updates a participant's subscription to tracks

    Parameters

    • room: string
    • identity: string
    • trackSids: string[]
    • subscribe: boolean

      true to subscribe, false to unsubscribe

    Returns Promise<void>

Generated using TypeDoc