LiveKit ESP32 SDK
Loading...
Searching...
No Matches
Room & Participant Info

Get information about a room and its participants. More...

Data Structures

struct  livekit_room_info_t
 Information about a room. More...
struct  livekit_participant_info_t
 Information about a participant in a room. More...

Enumerations

enum  livekit_participant_kind_t {
  LIVEKIT_PARTICIPANT_KIND_STANDARD = 0 , LIVEKIT_PARTICIPANT_KIND_INGRESS = 1 , LIVEKIT_PARTICIPANT_KIND_EGRESS = 2 , LIVEKIT_PARTICIPANT_KIND_SIP = 3 ,
  LIVEKIT_PARTICIPANT_KIND_AGENT = 4
}
 Participant kind. More...
enum  livekit_participant_state_t { LIVEKIT_PARTICIPANT_STATE_JOINING = 0 , LIVEKIT_PARTICIPANT_STATE_JOINED = 1 , LIVEKIT_PARTICIPANT_STATE_ACTIVE = 2 , LIVEKIT_PARTICIPANT_STATE_DISCONNECTED = 3 }
 Participant state. More...

Detailed Description

Get information about a room and its participants.

If you have worked with LiveKit before on other platforms, you will be familiar with the accessors on the room object and participant objects for getting information about them (e.g. sid, name, etc.). In this SDK, to avoid unnecessary persistent memory allocations that aren't needed for all applications, this information is instead provided through the following handlers which are invoked when the corresponding information is first received or subsequently updated:

In your implementation, you are free to examine the fields in the provided info struct and copy any information you need to keep for later use; the pointer to this struct is only valid until the handler returns.

The following example demonstrates how you can define an on_participant_info handler to perform some action when a participant named "Jon" joins the room:

static void on_participant_info(const livekit_participant_info_t* info, void* ctx)
{
strncmp(info->name, "Jon", 3) == 0)
{
ESP_LOGI(TAG, "Jon has joined the room");
}
}
char * name
Optional display name.
Definition livekit.h:174
livekit_participant_state_t state
The current state of the participant.
Definition livekit.h:180
@ LIVEKIT_PARTICIPANT_STATE_ACTIVE
The participant is connected to the room and can publish or subscribe to media.
Definition livekit.h:161
Information about a participant in a room.
Definition livekit.h:168

Data Structure Documentation

◆ livekit_room_info_t

struct livekit_room_info_t

Information about a room.

Data Fields
bool active_recording Whether the room is actively being recorded.
char * metadata Optional arbitrary metadata in string format.
char * name Optional display name.
uint32_t participant_count Number of participants in the room, including the local participant.
char * sid Unique identifier generated by LiveKit server.

◆ livekit_participant_info_t

struct livekit_participant_info_t

Information about a participant in a room.

Data Fields
char * identity Unique identity of the participant, as specified when connecting.
livekit_participant_kind_t kind The participant's kind (e.g. standard, agent, etc.).
char * metadata Optional arbitrary metadata in string format.
char * name Optional display name.
char * sid Unique identifier generated by LiveKit server.
livekit_participant_state_t state The current state of the participant.

Enumeration Type Documentation

◆ livekit_participant_kind_t

Participant kind.

Enumerator
LIVEKIT_PARTICIPANT_KIND_STANDARD 

A regular participant, typically an end-user in your application.

LIVEKIT_PARTICIPANT_KIND_INGRESS 

A server-side process that is ingesting media into the session using LiveKit Ingress.

LIVEKIT_PARTICIPANT_KIND_EGRESS 

A server-side process that is recording the session using LiveKit Egress.

LIVEKIT_PARTICIPANT_KIND_SIP 

A telephony user connected via SIP.

LIVEKIT_PARTICIPANT_KIND_AGENT 

An agent spawned with the Agents Framework.

◆ livekit_participant_state_t

Participant state.

Enumerator
LIVEKIT_PARTICIPANT_STATE_JOINING 

The participant is in the process of joining the room.

LIVEKIT_PARTICIPANT_STATE_JOINED 

The participant has joined the room but is not able to publish or subscribe to media yet.

LIVEKIT_PARTICIPANT_STATE_ACTIVE 

The participant is connected to the room and can publish or subscribe to media.

LIVEKIT_PARTICIPANT_STATE_DISCONNECTED 

The participant has disconnected from the room.