participants()

participants()

Compatibility:
Prebuilt
Custom

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

While there are some participant object properties specific to either the Daily Prebuilt or call object mode (more on that below), no matter how you're building with Daily, all participant objects include:

  • session_id - a unique id generated each time a participant joins a meeting
  • user_id - the user's id if set by a meeting token, otherwise the session_id
  • user_name - the user's name if set by a meeting token or set from the account if the user is logged into a Daily account
  • local - true for the local user
  • owner - true if set by a meeting token or the user is logged into a Daily account and is a member of the room's team
  • joined_at - js Date object, the time that the user joined the room
  • video_width and video_height - the current width and height of the live video stream. video_width and video_height can change as network conditions change. If there is no current camera stream, this will be an empty object.
  • record - indicates whether a participant is recording a meeting using local or output-byte-stream recording. This property will stay false for everyone when using cloud or rtp-tracks recording types. If you're building a custom UI, you probably want to monitor recording events instead of this property. (Note: Server-based recording (cloud and rtp-tracks) is a pay-as-you-go feature.)
  • tracks - an object whose keys are participant track types - audio, video, screenAudio and screenVideo - and whose values are objects with detailed information about each track.

Participant tracks properties

KeyDescriptionPossible values
subscribedWhether you (the local participant) are subscribed to a track
  • true
  • false
  • "staged": Keeps the connection for a track open, but stops any bytes from flowing across. Must be set via updateParticipant().
stateThe values represent the complete set of mutually exclusive states a track can be in, from the user's point of view.
  • "blocked": The track is blocked. See blocked field for details.
  • "off": The track is off, but not blocked (that we know of yet—it's possible that we haven't yet tried to access a device, in the case of the start_video_off room or meeting token property, say). See off field for details.
  • "sendable": The track is ready to be sent, but simply hasn't been subscribed to. It's neither blocked nor off.
  • "loading": The track is loading. It has been subscribed to, and is neither blocked nor off.
  • "playable": The track is ready to be played. It has been subscribed to, has finished loading, and is neither blocked nor off.
  • "interrupted": The track is currently unplayable (MediaStreamTrack.muted property is true). It may enter this state from the playable state.
offIf 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 and/or byBandwidth, representing the possible reasons the track is off.
blockedIf 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 or byPermissions or byDeviceInUse representing the possible reasons the track is blocked.
track**Only available when using the Daily call object.A MediaStreamTrack that is ready to be played.
persistentTrack**Only available when using the Daily call object.A MediaStreamTrack that exists and may or may not be ready to be played. For now, we recommend persistentTrack over track as a proactive defense against black frames during call disruptions and any browser limitations.

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.

Call object-only participant properties

If you're building an app on top of the Daily call object, you might notice a few additional returned properties in the participants object.

A note about the audioTrack, videoTrack, and screenVideoTrack properties in call object mode

These properties include the direct MediaStreamTrack that a participant is sending, if available.

While we detail these properties below, we recommend using the tracks property's key for each kind of track instead for more accurate, detailed tracks state.

  • videoTrack - the camera video track this participant is sending, if available.
  • audioTrack - the microphone audio track this participant is sending, if available. Contains the same information as videoTrack, with only the kind value differing in that it specifies "video".
  • screenVideoTrack: the screenshare video track this participant is sending, if available.