Client to access Room APIs

Hierarchy

  • default
    • RoomServiceClient

Constructors

Methods

  • 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>

  • 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

    • OptionaldestinationSids: string[]

      optional. when empty, message is sent to everyone

    Returns Promise<void>

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

  • Updates a participant's state or permissions

    Parameters

    • room: string

      target room

    • identity: string

      participant identity

    • options: UpdateParticipantOptions

      participant fields to update

    Returns Promise<ParticipantInfo>

  • Updates a participant's state or permissions

    Parameters

    • room: string

      target room

    • identity: string

      participant identity

    • Optionalmetadata: string
    • Optionalpermission: Partial<ParticipantPermission>
    • Optionalname: string

    Returns Promise<ParticipantInfo>

  • 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>