Exposes the ability to retrieve the participants in a video call effect. Each user on the call is considered a participant, including the host.
When a new user joins the call a new Participant
object is added to the array returned by getAllOtherParticipants()
and otherParticipantCount
is increased.
Participants are not removed from the array if they leave while the call is still active. This allows individual participants to retain the same unique ID that can be referenced for the duration of the video call, even after a dropout. Similarly, otherParticipantCount
is not decreased when a participant leaves. However, if the the video call ends then the participant array and count are both reset.
Importing this module automatically enables the Participants capability within the project's Properties.
Property | Description |
---|---|
effectGroupInitialised | (get) effectGroupInitialised: BoolSignal Whether the group apply of effect in video call initialised, that means all other participants trying to load the same effect has finished loading. |
otherParticipantCount | (get) otherParticipantCount: ScalarSignal The total number of participants in the video call, not including the current participant ( self ), as a ScalarSignal .To retrieve the total number of other participants active in the effect, use otherParticipantsInSameEffectCount instead. |
otherParticipantsInSameEffectCount | (get) otherParticipantsInSameEffectCount: ScalarSignal The total number of participants active in the effect, not including the current participant ( self ), as a ScalarSignal .To retrieve the total number of other participants in the video call whether they are active in the effect or not, use otherParticipantCount instead. |
self | (get) self: Promise<Participant> The current user, as a Participant object. |
Method | Description |
---|---|
getAllOtherParticipants | getAllOtherParticipants(): Promise<Array<Participant>> Returns an array of Participant objects containing all of the other participants in the video call, not including the current user (self ). |
getOtherParticipantsInSameEffect | getOtherParticipantsInSameEffect(): Promise<Array<Participant>> Returns an array of Participant objects containing all of the participants active in the effect, not including the current user (self ). |
getParticipantById | getParticipantById(id: string): Promise<Participant> Returns the Participant object attached to the unique ID specified.A Participant object's unique ID is accessible via its id property. For example:const otherParticipants = await Participants.getAllOtherParticipants(); |
onOtherParticipantAdded | onOtherParticipantAdded(): EventSource<Participant> Returns an EventSource object that emits a new Participant object each time a new participant joins the video call. For example:Participants.onOtherParticipantAdded().subscribe((participant) => { |
Class | Description |
---|---|
Participant | Exposes details of an individual participant in a video call effect. |