Skip to main content
Use call actions to create your own custom controls or trigger call functionality dynamically based on your use case. All actions are called on the CallSession singleton instance during an active call session.

Get CallSession Instance

The CallSession 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.

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.
Recording requires the feature to be enabled for your CometChat app.

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.

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

Returns true 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 for leaveSession(). Ends your participation and disconnects gracefully.

Start Call Recording

Alias for startRecording(). Begins server-side recording of the call.

Stop Call Recording

Alias for stopRecording(). Stops the current recording.

Set Call Layout Type

Alias for setLayout(). 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 on CallSession that return the current state of the local user in the call.