Patch Editor
Utility Patches
Participant Patches

Participant Patches Overview

Use Participant patches when building AR effects designed to be used in video calls, among several participants at once. These patches give you the ability to track all the participants in a video call and retrieve their ID and call activity.

You could use these patches, for example, if you’re building an AR game effect designed for a set number of players and you want your effect to respond in a certain way if one player leaves the game or video call.

Available Participant Patches

There are four patches that you can use to create these kinds of effects: Participant Finder, Participant Select, Participant and Participant ID. You can find them in Spark AR Studio, in the Utility section of the Patch Menu.

Name Description
Participant Finder

Find and identify the participants on a video call.

Participant Select

Select a participant from the other participants in the Participant Finder patch.

Participant

Output a participant’s status and ID. This could be the participant in the self-view or the other participants on the video call.

Participant ID

Specify the participant you want to select using the unique ID that identifies them in a video calling session. You can retrieve this ID from a script using the Participants.getParticipantById() method and then pass it to the participant ID patch.

Example

In the example patch graph below, we’ve connected the patches so the instructions Tap to Play are displayed on screen when both the participant in the self view and the second participant (with Index 1) is active in the call.

In the example patch graph below, we’ve connected the patches so the instructions Tap to Play are displayed on screen when both the participant in the self view and the second participant (with Index 1) is active in the call.

Patch graph that shows instructions when both the participant in self view and second participant are active

To find and select the participants we want, we connected:

  • The Self output of the Participant Finder to the top Participant patch. This finds and stores information on the participant in the self view.
  • The Other Participants output of the Participant Finder patch to the Other Participants input of Participant Select. This finds and selects between the other participants on the call. In the Participant Select patch, we entered 1 in the Index box to select the second person joining the call.
  • The Participant output of Participant Select to the bottom Participant patch, to store the information on the second caller.

To trigger instructions based on which participants are active, we connected:

  • The Active in Same Effect output of the top Participant patch to the First Boolean input of the And patch. This checks if the participant in the self view is active in the effect.
  • The Active in Same Effect output of the bottom Participant patch to the Second Boolean input in the And patch. This checks if the second person joining the call is also active in the effect.
  • The True output of the And patch to the custom instructions property patch for the Device. If both the self and second participant are found, a true boolean signal is sent to show Tap to play instructions in the effect.
Was this article helpful?