Participants

Participants are users connected to a room. There are two types: LocalParticipant (you) and RemoteParticipants (others).

Participant Types

Type Description Can Publish
LocalParticipant The current user (you) Yes (with permission)
RemoteParticipant Other users in the room N/A (subscribe only)

Local Participant

// Get local participant
LocalParticipant local = manager.getLocalParticipant();

// Participant info
String identity = local.getIdentity();
String name = local.getName();

// Publish tracks
local.publishAudioTrack(audioTrack);
local.publishVideoTrack(videoTrack);

Remote Participants

// Get all remote participants
Map<String, RemoteParticipant> participants = manager.getRemoteParticipants();

// Iterate through participants
for (RemoteParticipant participant : participants.values()) {
    Log.d("Participant", participant.getName() + " is in room");

    // Get their tracks
    for (TrackPublication pub : participant.getTracks()) {
        if (pub.getTrack() != null) {
            // Subscribe to track
        }
    }
}

Participant Events

manager.setEventListener(new ConoStreamEventListener() {
    @Override
    public void onParticipantJoined(RemoteParticipant participant) {
        Log.d("Room", participant.getName() + " joined");
    }

    @Override
    public void onParticipantLeft(RemoteParticipant participant) {
        Log.d("Room", participant.getName() + " left");
    }
});

Participant Roles (App-Level)

ConoStream doesn't enforce roles, but you can implement them in your app:

ℹ️

Participant permissions are controlled by the JWT token. See Authentication for details.