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

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

displayName: string

The display name of the participant

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

The status of this participant

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

A map of all video tracks on this participant

Methods

  • getAudioTracks returns all audio tracks for a participant

    Returns

    a list of all RemoteTrack with kind audio

    Returns RemoteTrack[]

  • getTracks returns all (video and audio) tracks for a participant

    Returns

    Returns RemoteTrack[]

  • getVideoTracks returns all video tracks for a participant

    Returns

    a list of all RemoteTrack with kind video

    Returns RemoteTrack[]

  • Checks whether the participant is subscribed.

    Returns

    true if the RemoteParticipant is subscribed

    Returns boolean

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

  • unsubscribes the LocalParticipant from this RemoteParticipant's media.

    After this promise resolves you can expect to receive one SpaceEvent.ParticipantTrackUnsubscribed event to fire for each RemoteTrack that this participant has published to the space.

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

    Returns Promise<void>

Generated using TypeDoc