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. Each listener is lifecycle-aware and automatically cleaned up when the Activity or Fragment is destroyed.
The CallSession is a singleton that manages the active call. All event listener registrations and session control methods are accessed through this instance.
All event listeners are lifecycle-aware and automatically removed when the LifecycleOwner (Activity/Fragment) is destroyed. You don’t need to manually remove listeners.
Monitor participant activities including join/leave, audio/video state, hand raise, screen sharing, and recording.
Kotlin
Java
Report incorrect code
Copy
Ask AI
callSession.addParticipantEventListener(this, object : ParticipantEventListener() { override fun onParticipantJoined(participant: Participant) { // A participant joined the call } override fun onParticipantLeft(participant: Participant) { // A participant left the call } override fun onParticipantListChanged(participants: List<Participant>) { // Participant list updated } override fun onParticipantAudioMuted(participant: Participant) {} override fun onParticipantAudioUnmuted(participant: Participant) {} override fun onParticipantVideoPaused(participant: Participant) {} override fun onParticipantVideoResumed(participant: Participant) {} override fun onParticipantHandRaised(participant: Participant) {} override fun onParticipantHandLowered(participant: Participant) {} override fun onParticipantStartedScreenShare(participant: Participant) {} override fun onParticipantStoppedScreenShare(participant: Participant) {} override fun onParticipantStartedRecording(participant: Participant) {} override fun onParticipantStoppedRecording(participant: Participant) {} override fun onDominantSpeakerChanged(participant: Participant) {}})
Report incorrect code
Copy
Ask AI
callSession.addParticipantEventListener(this, new ParticipantEventListener() { @Override public void onParticipantJoined(Participant participant) { // A participant joined the call } @Override public void onParticipantLeft(Participant participant) { // A participant left the call } @Override public void onParticipantListChanged(List<Participant> participants) { // Participant list updated } // Other callbacks...});
Monitor your local media state changes including audio/video status, recording, and device changes.
Kotlin
Java
Report incorrect code
Copy
Ask AI
callSession.addMediaEventsListener(this, object : MediaEventsListener() { override fun onAudioMuted() { // Your microphone was muted } override fun onAudioUnMuted() { // Your microphone was unmuted } override fun onVideoPaused() { // Your camera was turned off } override fun onVideoResumed() { // Your camera was turned on } override fun onRecordingStarted() { // Call recording started } override fun onRecordingStopped() { // Call recording stopped } override fun onScreenShareStarted() {} override fun onScreenShareStopped() {} override fun onAudioModeChanged(audioMode: AudioMode) { // Audio output device changed } override fun onCameraFacingChanged(facing: CameraFacing) { // Camera switched between front and back }})
Report incorrect code
Copy
Ask AI
callSession.addMediaEventsListener(this, new MediaEventsListener() { @Override public void onAudioMuted() { // Your microphone was muted } @Override public void onAudioUnMuted() { // Your microphone was unmuted } @Override public void onVideoPaused() { // Your camera was turned off } @Override public void onVideoResumed() { // Your camera was turned on } @Override public void onRecordingStarted() { // Call recording started } @Override public void onRecordingStopped() { // Call recording stopped } @Override public void onAudioModeChanged(AudioMode audioMode) { // Audio output device changed } @Override public void onCameraFacingChanged(CameraFacing facing) { // Camera switched between front and back } // Other callbacks...});