Hierarchy (view full)

Properties

audioLevel: number = 0

audio level between 0-1.0, 1 being loudest, 0 being softest

audioTrackPublications: Map<string, LocalTrackPublication>
identity: string

client assigned identity, encoded in JWT token

isSpeaking: boolean = false

if participant is currently speaking

lastSpokeAt?: Date
metadata?: string

client metadata, opaque to livekit

name?: string

client assigned display name, encoded in JWT token

permissions?: ParticipantPermission
sid: string

server assigned unique id

trackPublications: Map<string, LocalTrackPublication>

map of track sid => all published tracks

videoTrackPublications: Map<string, LocalTrackPublication>

Accessors

Methods

  • Publish both camera and microphone at the same time. This is useful for displaying a single Permission Dialog box to the end user.

    Returns Promise<void>

  • Publish a new data payload to the room. Data will be forwarded to each participant in the room if the destination field in publishOptions is empty

    Parameters

    • data: Uint8Array

      Uint8Array of the payload. To send string data, use TextEncoder.encode

    • options: DataPublishOptions = {}

      optionally specify a reliable, topic and destination

    Returns Promise<void>

  • Sets and updates the metadata of the local participant. The change does not take immediate effect. If successful, a ParticipantEvent.MetadataChanged event will be emitted on the local participant. Note: this requires canUpdateOwnMetadata permission.

    Parameters

    • metadata: string

    Returns void

  • Sets and updates the name of the local participant. The change does not take immediate effect. If successful, a ParticipantEvent.ParticipantNameChanged event will be emitted on the local participant. Note: this requires canUpdateOwnMetadata permission.

    Parameters

    • name: string

    Returns void

  • Control who can subscribe to LocalParticipant's published tracks.

    By default, all participants can subscribe. This allows fine-grained control over who is able to subscribe at a participant and track level.

    Note: if access is given at a track-level (i.e. both [allParticipantsAllowed] and [ParticipantTrackPermission.allTracksAllowed] are false), any newer published tracks will not grant permissions to any participants and will require a subsequent permissions update to allow subscription.

    Parameters

    • allParticipantsAllowed: boolean

      Allows all participants to subscribe all tracks. Takes precedence over [[participantTrackPermissions]] if set to true. By default this is set to true.

    • participantTrackPermissions: ParticipantTrackPermission[] = []

      Full list of individual permissions per participant/track. Any omitted participants will not receive any permissions.

    Returns void

Generated using TypeDoc