Participantrepresents a user that has joined a
Room. There are two types of participants:
The local client using the application is represented by the
LocalParticipant. It is created when the user joins a
Roomand is destroyed when the user leaves the
As the local participant is able to publish audio and video tracks, each room has a local participant.
const localParticipant = room.localParticipant; localParticipant.setMicrophoneEnabled(true); // mute the microphone localParticipant.setMicrophoneEnabled(false);
As the name suggests, a
RemoteParticipantrepresents a remote user that has joined a
In the audio graph, a
RemoteParticipantis 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.
RemoteParticipantscan 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;