Monitor participant activities with ParticipantEventListener. This listener provides callbacks for participant join/leave events, audio/video state changes, hand raise actions, screen sharing, recording, and more.
Register a ParticipantEventListener to receive participant event callbacks:
Kotlin
Java
Report incorrect code
Copy
Ask AI
val callSession = CallSession.getInstance()callSession.addParticipantEventListener(this, object : ParticipantEventListener() { override fun onParticipantJoined(participant: Participant) { Log.d(TAG, "${participant.name} joined the call") } override fun onParticipantLeft(participant: Participant) { Log.d(TAG, "${participant.name} left the call") } override fun onParticipantListChanged(participants: List<Participant>) { Log.d(TAG, "Participant list updated: ${participants.size} participants") } // Additional callbacks...})
Report incorrect code
Copy
Ask AI
CallSession callSession = CallSession.getInstance();callSession.addParticipantEventListener(this, new ParticipantEventListener() { @Override public void onParticipantJoined(Participant participant) { Log.d(TAG, participant.getName() + " joined the call"); } @Override public void onParticipantLeft(Participant participant) { Log.d(TAG, participant.getName() + " left the call"); } @Override public void onParticipantListChanged(List<Participant> participants) { Log.d(TAG, "Participant list updated: " + participants.size() + " participants"); } // Additional callbacks...});
The listener is automatically removed when the LifecycleOwner (Activity/Fragment) is destroyed, preventing memory leaks.
override fun onParticipantJoined(participant: Participant) { Log.d(TAG, "${participant.name} joined the call") // Show join notification // Update participant grid}
Report incorrect code
Copy
Ask AI
@Overridepublic void onParticipantJoined(Participant participant) { Log.d(TAG, participant.getName() + " joined the call"); // Show join notification // Update participant grid}
override fun onParticipantLeft(participant: Participant) { Log.d(TAG, "${participant.name} left the call") // Show leave notification // Update participant grid}
Report incorrect code
Copy
Ask AI
@Overridepublic void onParticipantLeft(Participant participant) { Log.d(TAG, participant.getName() + " left the call"); // Show leave notification // Update participant grid}
override fun onParticipantAudioMuted(participant: Participant) { Log.d(TAG, "${participant.name} muted their audio") // Show muted indicator on participant tile}
Report incorrect code
Copy
Ask AI
@Overridepublic void onParticipantAudioMuted(Participant participant) { Log.d(TAG, participant.getName() + " muted their audio"); // Show muted indicator on participant tile}
override fun onParticipantVideoPaused(participant: Participant) { Log.d(TAG, "${participant.name} paused their video") // Show avatar or placeholder instead of video}
Report incorrect code
Copy
Ask AI
@Overridepublic void onParticipantVideoPaused(Participant participant) { Log.d(TAG, participant.getName() + " paused their video"); // Show avatar or placeholder instead of video}
override fun onParticipantHandRaised(participant: Participant) { Log.d(TAG, "${participant.name} raised their hand") // Show hand raised indicator // Optionally play notification sound}
Report incorrect code
Copy
Ask AI
@Overridepublic void onParticipantHandRaised(Participant participant) { Log.d(TAG, participant.getName() + " raised their hand"); // Show hand raised indicator // Optionally play notification sound}
Triggered when a participant starts recording the session.
Kotlin
Java
Report incorrect code
Copy
Ask AI
override fun onParticipantStartedRecording(participant: Participant) { Log.d(TAG, "${participant.name} started recording") // Show recording indicator // Notify other participants}
Report incorrect code
Copy
Ask AI
@Overridepublic void onParticipantStartedRecording(Participant participant) { Log.d(TAG, participant.getName() + " started recording"); // Show recording indicator // Notify other participants}
Triggered when the dominant speaker changes (the participant currently speaking the loudest).
Kotlin
Java
Report incorrect code
Copy
Ask AI
override fun onDominantSpeakerChanged(participant: Participant) { Log.d(TAG, "${participant.name} is now the dominant speaker") // Highlight the dominant speaker's tile // Auto-focus on dominant speaker in spotlight mode}
Report incorrect code
Copy
Ask AI
@Overridepublic void onDominantSpeakerChanged(Participant participant) { Log.d(TAG, participant.getName() + " is now the dominant speaker"); // Highlight the dominant speaker's tile // Auto-focus on dominant speaker in spotlight mode}