A participant is one person (one identity) in one room.
When alice joins demo-room with her token, she becomes a participant in
it. Everyone else in the room sees her as a participant too.
Participants exist in your app, while the call is running. You don't create them on your backend. A participant appears when someone joins with a token, and disappears when they leave.
Why it exists
A track by itself is just audio or video. Your UI needs to know whose it is, to show "Alice's camera" with Alice's name under it. The participant links each track to a person.
Lifecycle
You choose the identity
The identity is whatever your backend put in the token: user-42, a UUID,
or an email. Livqeno doesn't care what it means. Use your own user id, so
you can look up the user's name and photo in your database.
- It only has to be unique in the room.
- Allowed characters: letters, numbers,
-,_, and. - Up to 128 characters.
The identity is signed into the token, so nobody can pretend to be someone else.
You and everyone else
In your app, the room gives you two lists:
room.localParticipant; // you
room.remoteParticipants; // everyone else| Type | Who | What you can do |
|---|---|---|
LocalParticipant | You, on this device | Publish your camera, mic, and screen. |
RemoteParticipant | Everyone else | Subscribe to (receive) their tracks. |
Publish means "send my media to the room". Subscribe means "receive someone else's media".
Example
In your browser app, log each new arrival, and show the camera of everyone already in the room:
room.on('participantJoined', (participant) => {
console.log(participant.identity, participant.tracks.length);
});
for (const p of room.remoteParticipants) {
const camera = p.tracks.find((t) => t.kind === 'camera');
if (camera) container.append(camera.attach());
}People already in the room are in remoteParticipants as soon as join
finishes. People who arrive later fire participantJoined. Handle both, or
you'll miss someone.
Next steps
- Track: what a participant publishes, and how to show it.
- Events: every participant and track event.
- Rooms & participants: building the call screen.