ParticipantEventListeners. This listener provides callbacks for participant join/leave events, audio/video state changes, hand raise actions, screen sharing, recording, and more.
Prerequisites
- An active call session
- Access to the
CallSessioninstance
Register Listener
Register aParticipantEventListeners to receive participant event callbacks:
Participant Object
TheParticipant object contains information about a call participant:
Callbacks
onParticipantJoined
Triggered when a new participant joins the call.- Display join notification/toast
- Update participant count
- Play join sound
onParticipantLeft
Triggered when a participant leaves the call.- Display leave notification
- Update participant count
- Play leave sound
onParticipantListChanged
Triggered when the participant list changes (join, leave, or any update).- Refresh participant list/grid
- Update participant count badge
- Sync local state with server
onParticipantAudioMuted
Triggered when a participant mutes their audio.onParticipantAudioUnmuted
Triggered when a participant unmutes their audio.onParticipantVideoPaused
Triggered when a participant pauses their video.onParticipantVideoResumed
Triggered when a participant resumes their video.onParticipantHandRaised
Triggered when a participant raises their hand.onParticipantHandLowered
Triggered when a participant lowers their hand.onParticipantStartedScreenShare
Triggered when a participant starts sharing their screen.onParticipantStoppedScreenShare
Triggered when a participant stops sharing their screen.onParticipantStartedRecording
Triggered when a participant starts recording the session.onParticipantStoppedRecording
Triggered when a participant stops recording the session.onDominantSpeakerChanged
Triggered when the dominant speaker changes (the participant currently speaking the loudest).- Highlight active speaker in UI
- Auto-switch spotlight to dominant speaker
- Show speaking indicator animation
Complete Example
Here’s a complete example handling all participant events:Remove Listener
Remove the listener in your widget’sdispose() method to prevent memory leaks:
Callbacks Summary
Next Steps
Media Events Listener
Handle local media state changes
Participant Actions
Control other participants