Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

audioLevel

audioLevel: number = 0

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

audioTracks

audioTracks: Map<string, LocalTrackPublication>

identity

identity: string

client assigned identity, encoded in JWT token

isSpeaking

isSpeaking: boolean = false

if participant is currently speaking

Optional lastSpokeAt

lastSpokeAt: Date

Optional metadata

metadata: string

client metadata, opaque to livekit

Optional name

name: string

client assigned display name, encoded in JWT token

Optional permissions

permissions: ParticipantPermission

sid

sid: string

server assigned unique id

tracks

tracks: Map<string, LocalTrackPublication>

map of track sid => all published tracks

videoTracks

videoTracks: Map<string, LocalTrackPublication>

Accessors

connectionQuality

isCameraEnabled

  • get isCameraEnabled(): boolean

isMicrophoneEnabled

  • get isMicrophoneEnabled(): boolean

isScreenShareEnabled

  • get isScreenShareEnabled(): boolean

joinedAt

  • get joinedAt(): undefined | Date

lastCameraError

  • get lastCameraError(): undefined | Error

lastMicrophoneError

  • get lastMicrophoneError(): undefined | Error

Methods

createScreenTracks

createTracks

enableCameraAndMicrophone

  • enableCameraAndMicrophone(): Promise<void>
  • 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>

getTrack

getTrackByName

getTracks

publishData

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

    Parameters

    • data: Uint8Array

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

    • kind: DataPacket_Kind

      whether to send this as reliable or lossy. For data that you need delivery guarantee (such as chat messages), use Reliable. For data that should arrive as quickly as possible, but you are ok with dropped packets, use Lossy.

    • Optional destination: RemoteParticipant[] | string[]

      the participants who will receive the message

    Returns Promise<void>

publishTrack

setCameraEnabled

  • setCameraEnabled(enabled: boolean): Promise<void>
  • Enable or disable a participant's camera track.

    If a track has already published, it'll mute or unmute the track.

    Parameters

    • enabled: boolean

    Returns Promise<void>

setMicrophoneEnabled

  • setMicrophoneEnabled(enabled: boolean): Promise<void>
  • Enable or disable a participant's microphone track.

    If a track has already published, it'll mute or unmute the track.

    Parameters

    • enabled: boolean

    Returns Promise<void>

setScreenShareEnabled

  • setScreenShareEnabled(enabled: boolean): Promise<void>

setTrackSubscriptionPermissions

  • setTrackSubscriptionPermissions(allParticipantsAllowed: boolean, participantTrackPermissions?: ParticipantTrackPermission[]): 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

unpublishTrack

unpublishTracks

Generated using TypeDoc