useParticipant
useParticipant(params): Object | null
useParticipant
returns a participant object for a given participant session_id
. If no participant is found for the given session_id
, returns null
.
useParticipant
can also be used to set up optional callbacks for participant-left
and participant-updated
events.
Params
Parameter | Required | Type | Description |
---|---|---|---|
session_id | ✓ | string | A unique identifier for the participant |
onParticipantLeft | Function | Callback for the participant-left event | |
onParticipantUpdated | Function | Callback for the participant-updated event |
Return type
Type | Description |
---|---|
Object | null | Contains detailed information about the participant, see participant properties. If no participant is found for a given session_id , useParticipant returns null |