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

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

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

  • unpublishAllTracks unpublishes all media for a LocalParticipant

    Parameters

    • options: {
          stop: boolean;
      } = ...

      Options for unpublishing tracks

      • stop: boolean

        Whether to stop tracks that are unpublished

    Returns void

  • unpublishTracks unpublishes a list of tracks from the space

    Parameters

    • tracks: LocalTrack[]
    • options: {
          stop: boolean;
      } = ...

      Options for unpublishing tracks

      • stop: boolean

        Whether to stop tracks that are unpublished

    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.

    Returns

    all LocalTracks that were sucessfully updated

    Parameters

    Returns LocalTrack[]

Generated using TypeDoc