Use call actions to create your own custom controls or trigger call functionality dynamically based on your use case. All actions are called on theDocumentation Index
Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
CallSession.shared 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.
- Swift
- Objective-C
Always 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.- Swift
- Objective-C
Unmute Audio
Unmutes your local microphone, resuming audio transmission.- Swift
- Objective-C
Set Audio Mode
Changes the audio output device during a call.- Swift
- Objective-C
AudioMode Values
AudioMode Values
| Value | Description |
|---|---|
SPEAKER | Routes audio through device loudspeaker |
EARPIECE | Routes audio through phone earpiece |
BLUETOOTH | Routes audio through connected Bluetooth device |
HEADPHONES | Routes audio through wired headphones |
Pause Video
Turns off your local camera, stopping video transmission. Other participants see your avatar.- Swift
- Objective-C
Resume Video
Turns on your local camera, resuming video transmission.- Swift
- Objective-C
Switch Camera
Toggles between front and back cameras without interrupting the video stream.- Swift
- Objective-C
Start Recording
Begins server-side recording of the call. All participants are notified.- Swift
- Objective-C
Stop Recording
Stops the current recording. The recording is saved and accessible via the dashboard.- Swift
- Objective-C
Mute Participant
Mutes a specific participant’s audio. This is a moderator action.- Swift
- Objective-C
Pause Participant Video
Pauses a specific participant’s video. This is a moderator action.- Swift
- Objective-C
Pin Participant
Pins a participant to keep them prominently displayed regardless of who is speaking.- Swift
- Objective-C
Unpin Participant
Removes the pin, returning to automatic speaker highlighting.- Swift
- Objective-C
Set Layout
Changes the call layout. Each participant can choose their own layout independently.- Swift
- Objective-C
LayoutType Values
LayoutType Values
| Value | Description |
|---|---|
TILE | Grid layout with equally-sized tiles |
SPOTLIGHT | Large view for active speaker, small tiles for others |
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.- Swift
- Objective-C
Disable Picture In Picture Layout
Disables PiP mode, returning to full-screen call interface.- Swift
- Objective-C
Set Chat Button Unread Count
Updates the badge count on the chat button. Pass 0 to hide the badge.- Swift
- Objective-C
Is Session Active
Returnstrue if a call session is active, false otherwise.
- Swift
- Objective-C
Leave Session
Ends your participation and disconnects gracefully. The call continues for other participants.- Swift
- Objective-C
Raise Hand
Shows a hand-raised indicator to get attention from other participants.- Swift
- Objective-C
Lower Hand
Removes the hand-raised indicator.- Swift
- Objective-C
Hide Settings Panel
Hides the settings panel if it’s currently visible.- Swift
- Objective-C
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 |