wide-dress-57902
08/19/2025, 10:58 PMtall-airline-16756
08/19/2025, 10:58 PMtall-airline-16756
08/19/2025, 10:58 PMwide-dress-57902
08/19/2025, 10:59 PMtall-airline-16756
08/19/2025, 11:00 PMParticipant
class in the LiveKit RTC module and its handy attributes:
• Identity and Identification:
◦ `sid`: This is the unique ID the server gives to each participant.
◦ `identity`: The identity the client assigns to the participant.
◦ `name`: The display name you see for the participant.
• Metadata and Custom Data:
◦ `metadata`: A custom metadata string tied to the participant.
◦ `attributes`: Custom attributes for the participant, provided as a dict[str, str]
.
• Participant Type and Status:
◦ `kind`: What kind of participant it is (like a regular participant, ingress, egress, SIP, or agent).
◦ `disconnect_reason`: If the participant disconnects, this tells you why — or it’s None
if they’re still connected.
• Track Management:
◦ `track_publications`: A dictionary listing the participant’s track publications (this is an abstract property, so subclasses will implement it).
There are also some internal attributes like _info
(which holds participant info) and _ffi_handle
(the FFI handle for the participant).
If you want me to dive deeper into any of these or need examples, just give me a shout!
Sources: livekit-rtc/livekit/rtc/_proto/room_pb2.pyiwide-dress-57902
08/19/2025, 11:01 PMtall-airline-16756
08/19/2025, 11:02 PMTrackMuted
and `TrackUnmuted`: Tracks get muted or unmuted.
• Participant State and Metadata Events:
◦ `ParticipantMetadataChanged`: Someone’s metadata gets updated.
◦ `ParticipantAttributesChanged`: Custom attributes for a participant change.
◦ `ParticipantPermissionsChanged`: Permissions for a participant get updated.
• Communication and Audio Events:
◦ `IsSpeakingChanged`: Someone starts or stops speaking.
◦ `ActiveSpeakersChanged`: The list of active speakers updates.
◦ `DataReceived`: You receive data from another participant.
• Quality and Connection Events:
◦ `ConnectionQualityChanged`: A participant’s connection quality shifts.
◦ `TrackStreamStateChanged`: A track you’re subscribed to gets paused, maybe due to bandwidth issues.
These events make it super easy to build apps that react in real-time to what’s happening with participants, tracks, and communication. If you want to dive deeper into any specific event or how to use it, just let me know—I’m here to help!
Sources: src/room/Room.ts | Handling events | LiveKit Docs | livekit-rtc/livekit/rtc/room.py | livekit-android-sdk/src/main/java/io/livekit/android/events/ParticipantEven...wide-dress-57902
08/19/2025, 11:02 PMtall-airline-16756
08/19/2025, 11:03 PMsetAttributes
in JavaScript.
• Server-Side Updates: Attributes can also be updated through server APIs, and these updates get synced to everyone in the room.
• Initial Connection: You can set attributes right in the participant's access token, so they’re ready to go as soon as they connect.
• Programmatic Changes: Apps can tweak attributes based on events, like switching translation preferences on the fly.
Whenever attributes change, LiveKit spots the differences and fires off events like participant_attributes_changed
(Python) or AttributesChanged
(JavaScript). These events tell you what changed and who it happened to.
Just a heads-up: participants need the canUpdateOwnMetadata
permission in their access token to update their own attributes. Also, while attributes sync across everyone, they’re not ideal for super frequent updates because of the server overhead.
If you want to dive deeper into any part of this, just let me know—I’m here to help!
Sources: livekit-rtc/livekit/rtc/room.py | Sources/LiveKit/Participant/Participant.swift | Participant attributes and metadata | LiveKit Docs | server/main.py | src/room/events.ts