Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RemoteParticipant

A RemoteParticipant is a remote peer connected to the space. While Remote Participant events are emitted on Space remote participants can also emit ParticipantEvent to give you more fine grained control.

Hierarchy

  • EventEmitter
    • RemoteParticipant

Index

Properties

audioTracks: Map<string, RemoteTrack> = ...

A map of all audio tracks on this participant

connectionId: string

A unique connection id generated every time a participant connects to a space

id: string

The unique participant id derived from the participant_id field in the JWT

The role for this participant in the space. This can be one of ParticipantRole.Publisher or ParticipantRole.Subscriber

subscribed: boolean

Whether this participant is currently subscribed to or not

videoTracks: Map<string, RemoteTrack> = ...

A map of all video tracks on this participant

Methods

  • getAudioTracks returns all audio tracks for a participant

    Returns RemoteTrack[]

    a list of all RemoteTrack with kind audio

  • getVideoTracks returns all video tracks for a participant

    Returns RemoteTrack[]

    a list of all RemoteTrack with kind video

  • subscribe(): Promise<void>
  • subscribes the LocalParticipant to this RemoteParticipant's media.

    After this promise resolves you can expect to receive one SpaceEvent.ParticipantTrackSubscribed event to fire for each RemoteTrack that this participant has published to the space. Subsequent tracks that this participant publishes will be automatically subscribed to until unsubscribed is called.

    NOTE: This function may only be called when [[SpaceOptions.subscriptionMode]] is set to SubscriptionMode.Manual.

    Returns Promise<void>

  • unsubscribe(): Promise<void>

Generated using TypeDoc