Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LocalParticipant

A LocalParticipant is the local peer connected to the space. Local participants can emit ParticipantEvent to allow you to respond to state updates.

Hierarchy

  • EventEmitter
    • LocalParticipant

Index

Properties

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

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 specified by the role field in the JWT. If none is specificed, the default is ParticipantRole.Publisher

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

A map of all video tracks on this participant

Methods

  • getAudioTracks returns all audio tracks for a participant

    Returns LocalTrack[]

  • getVideoTracks returns all video tracks for a participant

    Returns LocalTrack[]

  • publishTracks publishes an array of LocalTrack to the space

    Parameters

    Returns Promise<LocalTrack[]>

  • unpublishAllTracks(): Promise<void>
  • unpublishAllTracks unpublishes all media for a LocalParticipant

    Returns Promise<void>

  • unpublishTracks unpublishes a list of tracks from the space

    Parameters

    Returns void

  • updateTracks updates an array of LocalTrack based on TrackSource. This replaces the underlying media being sent to the space without the need to unpublish and republish tracks. This should be used with getDisplayMedia to update a camera or microphone input.

    Note: If you pass a track source that isn't already published it will not be updated. For example, say you are publishing a Camera source but not a Microphone source. If you pass in a track with a source of TrackSource.Microphone nothing will happen.

    Parameters

    Returns LocalTrack[]

    all LocalTracks that were sucessfully updated

Generated using TypeDoc