CallSession singleton instance during an active call session.
Get CallSession Instance
TheCallSession is a singleton that manages the active call. All actions are accessed through this instance.
CallSession.getInstance() returns null if no active session exists. Always use the null-aware ?. operator when calling actions, or check isCallSessionActive() before calling actions to ensure there’s an active call.Actions
Mute Audio
Mutes your local microphone, stopping audio transmission to other participants.Unmute Audio
Unmutes your local microphone, resuming audio transmission.Set Audio Mode
Changes the audio output device during a call.AudioMode Values
AudioMode Values
| Value | Description |
|---|---|
AudioMode.speaker | Routes audio through device loudspeaker |
AudioMode.earpiece | Routes audio through phone earpiece |
AudioMode.bluetooth | Routes audio through connected Bluetooth device |
Pause Video
Turns off your local camera, stopping video transmission. Other participants see your avatar.Resume Video
Turns on your local camera, resuming video transmission.Switch Camera
Toggles between front and rear cameras without interrupting the video stream.Start Recording
Begins server-side recording of the call. All participants are notified.Stop Recording
Stops the current recording. The recording is saved and accessible via the dashboard.Mute Participant
Mutes a specific participant’s audio. This is a moderator action.Pause Participant Video
Pauses a specific participant’s video. This is a moderator action.Pin Participant
Pins a participant to keep them prominently displayed regardless of who is speaking.Unpin Participant
Removes the pin, returning to automatic speaker highlighting.Set Layout
Changes the call layout. Each participant can choose their own layout independently.LayoutType Values
LayoutType Values
| Value | Description |
|---|---|
LayoutType.tile | Grid layout with equally-sized tiles |
LayoutType.spotlight | Large view for active speaker, small tiles for others |
LayoutType.sidebar | Main speaker with participants in a sidebar |
Enable Picture In Picture Layout
Enables PiP mode, allowing the call to continue in a floating window.Disable Picture In Picture Layout
Disables PiP mode, returning to full-screen call interface.Enter PiP Mode
Enters the system Picture-in-Picture mode directly.PiP behavior differs between platforms. Android uses the system PiP window, while iOS uses a custom overlay. Use
isPipSupported() to check availability before calling this method.Set Chat Button Unread Count
Updates the badge count on the chat button. Pass 0 to hide the badge.Is Session Active
Returnstrue if a call session is active, false otherwise.
Leave Session
Ends your participation and disconnects gracefully. The call continues for other participants.Raise Hand
Shows a hand-raised indicator to get attention from other participants.Lower Hand
Removes the hand-raised indicator.Toggle Methods
Convenience methods that toggle between two states. These check the current state and call the appropriate action automatically.Toggle Mute Audio
Toggles between muted and unmuted audio.Toggle Pause Video
Toggles between paused and resumed video.Toggle Camera Source
Toggles between front and rear camera.Toggle Raise Hand
Toggles between raised and lowered hand.Alias Methods
These methods are aliases for existing actions, provided for naming convenience.End Call Session
Alias forleaveSession(). Ends your participation and disconnects gracefully.
Start Call Recording
Alias forstartRecording(). Begins server-side recording of the call.
Stop Call Recording
Alias forstopRecording(). Stops the current recording.
Set Call Layout Type
Alias forsetLayout(). Changes the call layout.
Settings Panel Methods
Methods for controlling the in-call settings panel.Hide Settings Panel
Hides the settings panel if it is currently visible.Open Call Settings Panel
Opens the general call settings panel.Open Virtual Background Settings Panel
Opens the virtual background settings panel.State Getters
Read-only properties onCallSession that return the current state of the local user in the call.
| Property | Type | Description |
|---|---|---|
isAudioMuted | bool | Whether local audio is currently muted |
isVideoPaused | bool | Whether local video is currently paused |
isHandRaised | bool | Whether the local user’s hand is raised |
isRecording | bool | Whether the call is currently being recorded |
Participant Object Reference
Participant Object Reference
| Property | Type | Description |
|---|---|---|
uid | String | Unique identifier (CometChat user ID) |
name | String | Display name |
avatar | String | URL of avatar image |
pid | String | Participant ID for this call session |
role | String | Role in the call |
audioMuted | bool | Whether audio is muted |
videoPaused | bool | Whether video is paused |
isPinned | bool | Whether pinned in layout |
isPresenting | bool | Whether screen sharing |
raisedHandTimestamp | int | Timestamp when hand was raised |