Options
All
  • Public
  • Public/Protected
  • All
Menu

Client to access Room APIs

Hierarchy

  • RoomServiceClient

Index

Constructors

constructor

  • new RoomServiceClient(host: string, apiKey?: string, secret?: string): RoomServiceClient

Methods

createRoom

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

deleteRoom

  • deleteRoom(room: string): Promise<void>

getParticipant

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

listParticipants

listRooms

  • listRooms(names?: string[]): Promise<Room[]>
  • List active rooms

    Parameters

    • Optional names: string[]

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

    Returns Promise<Room[]>

mutePublishedTrack

  • mutePublishedTrack(room: string, identity: string, trackSid: string, muted: boolean): Promise<TrackInfo>
  • 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>

removeParticipant

  • removeParticipant(room: string, identity: string): Promise<void>
  • 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>

sendData

  • sendData(room: string, data: Uint8Array, kind: DataPacket_Kind, destinationSids?: string[]): Promise<void>
  • Sends data message to participants in the room

    Parameters

    • room: string
    • data: Uint8Array

      opaque payload to send

    • kind: DataPacket_Kind

      delivery reliability

    • destinationSids: string[] = []

      optional. when empty, message is sent to everyone

    Returns Promise<void>

updateParticipant

  • Updates a participant's metadata or permissions

    Parameters

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

      optional, metadata to update

    • Optional permission: ParticipantPermission

      optional, new permissions to assign to participant

    Returns Promise<ParticipantInfo>

updateRoomMetadata

  • updateRoomMetadata(room: string, metadata: string): Promise<Room>
  • Update metadata of a room

    Parameters

    • room: string

      name of the room

    • metadata: string

      the new metadata for the room

    Returns Promise<Room>

updateSubscriptions

  • updateSubscriptions(room: string, identity: string, trackSids: string[], subscribe: boolean): Promise<void>
  • 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