client assigned identity, encoded in JWT token
if participant is currently speaking
OptionallastOptionalmetadataclient metadata, opaque to livekit
Optionalnameclient assigned display name, encoded in JWT token
Optionalpermissionsserver assigned unique id
map of track sid => all published tracks
participant attributes, similar to metadata, but as a key/value map
when participant joined the room
Creates a screen capture tracks with getDisplayMedia(). A LocalVideoTrack is always created and returned. If { audio: true }, and the browser supports audio capture, a LocalAudioTrack is also created.
Optionaloptions: ScreenShareCaptureOptionsCreate local camera and/or microphone tracks
Optionaloptions: CreateLocalTracksOptionsConsider migrating to sendText
Publish both camera and microphone at the same time. This is useful for displaying a single Permission Dialog box to the end user.
Finds the first track that matches the source filter, for example, getting the user's camera track with getTrackBySource(Track.Source.Camera).
Finds the first track that matches the track's name.
Initiate an RPC call to a remote participant
Parameters for initiating the RPC call, see PerformRpcParams
A promise that resolves with the response payload or rejects with an error.
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
Uint8Array of the payload. To send string data, use TextEncoder.encode
optionally specify a reliable, topic and destination
Publish SIP DTMF message to the room.
DTMF code
DTMF digit
Publish a new track to the room
Optionaloptions: TrackPublishOptionsOptionaloptions: TrackPublishOptionsOptionaloptions: SendTextOptionsConsider migrating to sendText
Send a File to all participants in the room via the data channel.
The File object payload
Optionaloptions: SendFileOptionsTopic identifier used to route the stream to appropriate handlers.
A callback function used to monitor the upload progress percentage.
Sends the given string to participants in the room via the data channel. For longer messages, consider using streamText instead.
The text payload
Optionaloptions: SendTextOptionsOptionalattachments?: File[]Optionalattributes?: Record<string, string>OptionaldestinationIdentities?: string[]OptionalonProgress?: (progress: number) => voidOptionaltopic?: stringSet or update participant attributes. It will make updates only to keys that
are present in attributes, and will not override others.
Note: this requires canUpdateOwnMetadata permission.
attributes to update
Enable or disable a participant's camera track.
If a track has already published, it'll mute or unmute the track.
Resolves with a LocalTrackPublication instance if successful and undefined otherwise
Optionaloptions: VideoCaptureOptionsOptionalpublishOptions: TrackPublishOptionsSets and updates the metadata of the local participant.
Note: this requires canUpdateOwnMetadata permission.
method will throw if the user doesn't have the required permissions
Enable or disable a participant's microphone track.
If a track has already published, it'll mute or unmute the track.
Resolves with a LocalTrackPublication instance if successful and undefined otherwise
Optionaloptions: AudioCaptureOptionsOptionalpublishOptions: TrackPublishOptionsSets and updates the name of the local participant.
Note: this requires canUpdateOwnMetadata permission.
method will throw if the user doesn't have the required permissions
Start or stop sharing a participant's screen
Resolves with a LocalTrackPublication instance if successful and undefined otherwise
Optionaloptions: ScreenShareCaptureOptionsOptionalpublishOptions: TrackPublishOptionsControl 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.
Allows all participants to subscribe all tracks. Takes precedence over [[participantTrackPermissions]] if set to true. By default this is set to true.
Full list of individual permissions per participant/track. Any omitted participants will not receive any permissions.
Stream bytes incrementally to participants in the room via the data channel. For sending files, consider using sendFile instead.
Optionaloptions: StreamBytesOptionsTopic identifier used to route the stream to appropriate handlers.
OptionalstopOnUnpublish: booleanWaits until the participant is active and ready to receive data messages
a promise that resolves when the participant is active
audio level between 0-1.0, 1 being loudest, 0 being softest