Returns an object with the total participant counts for both present (or active) and hidden (or passive) participants in the current call.

"Present" refers to all participants in a call who appear in participants(). They have their hasPresence permission set to true. Present participants can be seen by others, and therefore can share their media (mic, camera, etc.) with others.

"Hidden" participants are those who are absent from participants(). They have their hasPresence permission set to false. Hidden participants can't be seen by others, and therefore can't share their media.

participantCounts() is useful, for example, in a component that just shows how many people are in a room but doesn't show anything else about the participants. It's especially useful when you don't expect all participants to be present, such as in a room configured to accommodate large meetings by making participants hidden by default.

The sum of the present and hidden participant count values will be the total number of participants joined in a call.

participantCounts() will include the local participant in its totals, either as hidden or present depending on the local participant's status.

participantCounts() values will only be updated once the participant has officially joined a call. This does not include when a participant has only completed optional pre-join steps, such as pre-authenticating via preAuth() or using the startCamera() method to access local devices.