participants()
participants()
Returns an object detailing the current meeting participants:
The object keys are local for the local participant and the participant's session_id for remote participants.
Participant properties
All participant objects include:
session_id- a unique ID generated each time a participant joins a meetinguser_id- the user's ID if set by a meeting token, otherwise thesession_iduser_name- the user's name if set by a meeting token, iframe properties, or viasetUserName()local-truefor the local userowner-trueif set by a meeting token or the user is logged into a Daily account and is a member of the room's teamjoined_at- js Date object, the time that the user joined the roomrecord- indicates whether a participant is recording a meeting (Note: Server-based recording (cloud) is a paid feature.)networkQualityState- a string representing the current network quality state of the participant. Possible values are'good','warning','bad', and'unknown'. For the local participant, this matches thenetworkStatevalue returned by getNetworkStats().tracks- an object whose keys are participant track types -audio,video,screenAudioandscreenVideo- and whose values are objects with detailed information about each track.permissions- an object that describes what the participant is permitted to do during this call. There are four keys on the object, each representing a permission:hasPresence,canSend,canReceive, andcanAdmin.
Participant tracks properties
| Key | Description | Possible values |
|---|---|---|
subscribed | Whether you (the local participant) are subscribed to a track |
|
state | The values represent the complete set of mutually exclusive states a track can be in, from the user's point of view. |
|
off | If the track is off, why it's off (this field only acquires a value if the track is off). | An optional object with the properties byUser, byRemoteRequest, byBandwidth, byCanSendPermission, byCanReceivePermission (remote participants only), or byServerLimit, representing the possible reasons the track is off. |
blocked | If the track is blocked, why it's blocked (this field only acquires a value if the track is blocked). | An optional object with the properties byMissingDevice, byPermissions, or byDeviceInUse representing the possible reasons the track is blocked. |
track | A MediaStreamTrack that is ready to be played. |
tracks in action
Participant permissions properties
| Key | Description | Possible values |
|---|---|---|
hasPresence | Whether the participant appears as "present" in the call, i.e. whether they appear in participants(). |
|
canSend | Which types of media a participant should be permitted to send. |
|
canReceive | Which types of media the participant should be permitted to receive from whom. | An object specifying which media the participant should be permitted to receive. Adheres to the format specified in the following section. |
canAdmin | Which types of admin tasks a participant should be permitted to do. |
|
permissions in action
- Use the
updateParticipant()updatePermissionsaction - Set the
permissionsproperty in domain, room, and meeting token configurations - Call the
update-permissionsREST API
permissions.canReceive properties
| Key | Description | Possible values |
|---|---|---|
base | Which types of media the participant should be permitted to receive from any remote participant. For a given remote participant, the setting for each piece of media may be overridden by a corresponding setting in byUserId or byParticipantId. |
|
byUserId | A mapping between remote user_ids and the media types the local participant should be permitted to receive from that participant.For a given remote participant, the setting for each piece of media provided here overrides the corresponding setting in base. | An object mapping between remote user_ids and either:
|
byParticipantId | A mapping between remote participant IDs and the media types the local participant should be permitted to receive from that participant. For a given remote participant, the setting for each piece of media provided here overrides the corresponding setting in base and byUserId. | An object mapping between remote participant IDs and either:
|
Optional properties
userData- custom data associated with the participant, settable via iframe properties orsetUserData()
A note about the audio, video, and screen properties
These three properties' boolean values indicate whether the corresponding audio, video, or screen track is available locally and ready to be sent.
However, when a track isn't yet available ("loading"), the value will briefly be false.
We highly recommend skipping these properties and using the tracks property's key for each kind of track instead for more accurate, detailed tracks state.
A note about the audioTrack, videoTrack, and screenVideoTrack properties
These properties include the direct MediaStreamTrack that a participant is sending, if available.
We recommend skipping these properties and using the tracks property's key for each kind of track instead.
A note about the networkThreshold property
This property corresponds to the deprecated threshold value in getNetworkStats().
We recommend skipping this property and using the networkQualityState property instead.