Handle call session events to build responsive UIs. The SDK provides five event listener interfaces to monitor session status, participant activities, media changes, button clicks, and layout changes. Unlike Android, Flutter listeners are not lifecycle-aware and must be manually removed inDocumentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
dispose() to prevent memory leaks.
Get CallSession Instance
TheCallSession is a singleton that manages the active call. All event listener registrations and session control methods are accessed through this instance.
Session Events
Monitor the call session lifecycle including join/leave events and connection status.| Event | Description |
|---|---|
onSessionJoined | Successfully connected and joined the session |
onSessionLeft | Left the session via leaveSession() or was removed |
onSessionTimedOut | Session ended due to inactivity timeout |
onConnectionLost | Network interrupted, SDK attempting reconnection |
onConnectionRestored | Connection restored after being lost |
onConnectionClosed | Connection permanently closed, cannot reconnect |
Participant Events
Monitor participant activities including join/leave, audio/video state, hand raise, screen sharing, and recording.| Event | Parameter | Description |
|---|---|---|
onParticipantJoined | Participant | A participant connected to the call |
onParticipantLeft | Participant | A participant disconnected from the call |
onParticipantListChanged | List<Participant> | Participant list updated |
onParticipantAudioMuted | Participant | A participant muted their microphone |
onParticipantAudioUnmuted | Participant | A participant unmuted their microphone |
onParticipantVideoPaused | Participant | A participant turned off their camera |
onParticipantVideoResumed | Participant | A participant turned on their camera |
onParticipantHandRaised | Participant | A participant raised their hand |
onParticipantHandLowered | Participant | A participant lowered their hand |
onParticipantStartedScreenShare | Participant | A participant started screen sharing |
onParticipantStoppedScreenShare | Participant | A participant stopped screen sharing |
onParticipantStartedRecording | Participant | A participant started recording |
onParticipantStoppedRecording | Participant | A participant stopped recording |
onDominantSpeakerChanged | Participant | The active speaker changed |
Media Events
Monitor your local media state changes including audio/video status, recording, and device changes.| Event | Parameter | Description |
|---|---|---|
onAudioMuted | - | Your microphone was muted |
onAudioUnMuted | - | Your microphone was unmuted |
onVideoPaused | - | Your camera was turned off |
onVideoResumed | - | Your camera was turned on |
onRecordingStarted | - | Call recording started |
onRecordingStopped | - | Call recording stopped |
onScreenShareStarted | - | You started screen sharing |
onScreenShareStopped | - | You stopped screen sharing |
onAudioModeChanged | AudioMode | Audio output device changed |
onCameraFacingChanged | CameraFacing | Camera switched between front and rear |
AudioMode Values
AudioMode Values
| Value | Description |
|---|---|
AudioMode.speaker | Audio routed through device loudspeaker |
AudioMode.earpiece | Audio routed through phone earpiece |
AudioMode.bluetooth | Audio routed through connected Bluetooth device |
CameraFacing Values
CameraFacing Values
| Value | Description |
|---|---|
CameraFacing.front | Front-facing (selfie) camera is active |
CameraFacing.rear | Rear-facing (main) camera is active |
Button Click Events
Intercept UI button clicks from the default call interface to add custom behavior or analytics.| Event | Description |
|---|---|
onLeaveSessionButtonClicked | Leave/end call button was tapped |
onToggleAudioButtonClicked | Mute/unmute button was tapped |
onToggleVideoButtonClicked | Video on/off button was tapped |
onSwitchCameraButtonClicked | Camera switch button was tapped |
onRaiseHandButtonClicked | Raise hand button was tapped |
onShareInviteButtonClicked | Share/invite button was tapped |
onChangeLayoutButtonClicked | Layout change button was tapped |
onParticipantListButtonClicked | Participant list button was tapped |
onChatButtonClicked | In-call chat button was tapped |
onRecordingToggleButtonClicked | Recording toggle button was tapped |
Button click events fire before the SDK’s default action executes. Use these to add custom logic alongside default behavior.
Layout Events
Monitor layout changes including layout type switches and Picture-in-Picture mode transitions.| Event | Parameter | Description |
|---|---|---|
onCallLayoutChanged | LayoutType | Call layout changed |
onParticipantListVisible | - | Participant list panel was opened |
onParticipantListHidden | - | Participant list panel was closed |
onPictureInPictureLayoutEnabled | - | Call entered Picture-in-Picture mode |
onPictureInPictureLayoutDisabled | - | Call exited Picture-in-Picture mode |
LayoutType Values
LayoutType Values
| Value | Description | Best For |
|---|---|---|
LayoutType.tile | Grid layout with equally-sized tiles | Group discussions, team meetings |
LayoutType.spotlight | Large view for active speaker, small tiles for others | Presentations, one-on-one calls |