Participants
A
Participant
represents a user that has joined a Room
.
There are two types of participants: LocalParticipant
and RemoteParticipant
.Local Participant
The local client using the application is represented by the
LocalParticipant
.
It is created when the user joins a Room
and is destroyed when the user leaves the Room
.As the local participant is able to publish audio and video tracks, each room has a local participant.
Basic Usage
Publish Microphone
const localParticipant = room.localParticipant;
localParticipant.setMicrophoneEnabled(true);
// mute the microphone
localParticipant.setMicrophoneEnabled(false);
Remote Participant
As the name suggests, a
RemoteParticipant
represents a remote user that has joined a Room
.In the audio graph, a
RemoteParticipant
is represented by an Audio Object.
With that, you can set the position and all other audio properties of remote participant.Remote participants are automatically connected to the local participant, so you can hear them as soon as they join the room.
Basic Usage
Accessing a RemoteParticipant
RemoteParticipants
can be accessed via the respective Room
. You can either access
a single participant via its identity or get a list of tuples of the form.[participantIdentity: string, participant: atmoky.RemoteParticipant]
const remoteParticipant = room.getParticipantByIdentity(
"<participantIdentity>"
);
const participants = room.participants;