CometChat Calls SDK v5 — Session Settings
Overview
SessionSettingsBuilder configures every aspect of a call session before joining. Settings are immutable after build() — pass the result to joinSession().
Key Imports
import com.cometchat.calls.core.CometChatCalls
import com.cometchat.calls.model.SessionType // VIDEO, VOICE
import com.cometchat.calls.model.LayoutType // TILE, SIDEBAR, SPOTLIGHT
import com.cometchat.calls.model.AudioMode // SPEAKER, EARPIECE, BLUETOOTH, HEADPHONES
import com.cometchat.calls.model.CameraFacing // FRONT, REAR
Implementation
Full Builder Example
val sessionSettings = CometChatCalls.SessionSettingsBuilder()
// Identity
.setTitle("Team Meeting")
.setDisplayName("John Doe")
// Session type & layout
.setSessionType(SessionType.VIDEO) // VIDEO or VOICE
.setLayout(LayoutType.TILE) // TILE, SIDEBAR, or SPOTLIGHT
// Initial media state
.startAudioMuted(false)
.startVideoPaused(false)
.setAudioMode(AudioMode.SPEAKER) // SPEAKER, EARPIECE, BLUETOOTH, HEADPHONES
.setInitialCameraFacing(CameraFacing.FRONT) // FRONT or REAR
// Timeout & recording
.setIdleTimeoutPeriod(300) // seconds (default 300)
.enableAutoStartRecording(false)
// Hide panels
.hideControlPanel(false)
.hideHeaderPanel(false)
.hideSessionTimer(false)
// Hide individual buttons
.hideLeaveSessionButton(false)
.hideToggleAudioButton(false)
.hideToggleVideoButton(false)
.hideSwitchCameraButton(false)
.hideRecordingButton(true) // hidden by default
.hideAudioModeButton(false)
.hideRaiseHandButton(false)
.hideShareInviteButton(true) // hidden by default
.hideParticipantListButton(false)
.hideChangeLayoutButton(false)
.hideChatButton(true) // hidden by default
// Notifications
.enableNotifications(true) // toggle in-session notifications (default true)
.build()
Enum Values Reference
| Enum |
Values |
SessionType |
VIDEO, VOICE |
LayoutType |
TILE, SIDEBAR, SPOTLIGHT |
AudioMode |
SPEAKER, EARPIECE, BLUETOOTH, HEADPHONES |
CameraFacing |
FRONT, REAR |
Common Presets
Voice call:
.setSessionType(SessionType.VOICE)
.setLayout(LayoutType.SPOTLIGHT)
.setAudioMode(AudioMode.EARPIECE)
.startVideoPaused(true)
Video call:
.setSessionType(SessionType.VIDEO)
.setLayout(LayoutType.TILE)
.setAudioMode(AudioMode.SPEAKER)
.startVideoPaused(false)
Custom UI (hide default controls):
.hideControlPanel(true)
.hideHeaderPanel(true)
Button Defaults
| Button |
Default Hidden? |
| Recording |
Yes (true) |
| Share Invite |
Yes (true) |
| Chat |
Yes (true) |
| All others |
No (false) |
Gotchas
- Settings are immutable after
build() — create a new builder for changes
SessionType uses VOICE not "AUDIO"
LayoutType values: TILE, SIDEBAR, SPOTLIGHT — all caps
setIdleTimeoutPeriod() takes seconds, default is 300 (5 minutes)
- Recording, share invite, and chat buttons are hidden by default
- These are pre-session configs only; use
CallSession actions for runtime changes
Sample App Reference
CallActivity.kt — joinSession() method builds settings based on voice/video call type
1---2name: session-settings3description: Configure all SessionSettingsBuilder options — layouts, session type, audio mode, hide buttons, idle timeout, recording, camera facing. Use when customizing call UI or pre-session config. Triggers on "SessionSettingsBuilder", "session settings", "hide button", "layout type", "audio mode", "idle timeout".4---56# CometChat Calls SDK v5 — Session Settings78## Overview910`SessionSettingsBuilder` configures every aspect of a call session before joining. Settings are immutable after `build()` — pass the result to `joinSession()`.1112## Key Imports1314```kotlin15import com.cometchat.calls.core.CometChatCalls16import com.cometchat.calls.model.SessionType // VIDEO, VOICE17import com.cometchat.calls.model.LayoutType // TILE, SIDEBAR, SPOTLIGHT18import com.cometchat.calls.model.AudioMode // SPEAKER, EARPIECE, BLUETOOTH, HEADPHONES19import com.cometchat.calls.model.CameraFacing // FRONT, REAR20```2122## Implementation2324### Full Builder Example2526```kotlin27val sessionSettings = CometChatCalls.SessionSettingsBuilder()28 // Identity29 .setTitle("Team Meeting")30 .setDisplayName("John Doe")3132 // Session type & layout33 .setSessionType(SessionType.VIDEO) // VIDEO or VOICE34 .setLayout(LayoutType.TILE) // TILE, SIDEBAR, or SPOTLIGHT3536 // Initial media state37 .startAudioMuted(false)38 .startVideoPaused(false)39 .setAudioMode(AudioMode.SPEAKER) // SPEAKER, EARPIECE, BLUETOOTH, HEADPHONES40 .setInitialCameraFacing(CameraFacing.FRONT) // FRONT or REAR4142 // Timeout & recording43 .setIdleTimeoutPeriod(300) // seconds (default 300)44 .enableAutoStartRecording(false)4546 // Hide panels47 .hideControlPanel(false)48 .hideHeaderPanel(false)49 .hideSessionTimer(false)5051 // Hide individual buttons52 .hideLeaveSessionButton(false)53 .hideToggleAudioButton(false)54 .hideToggleVideoButton(false)55 .hideSwitchCameraButton(false)56 .hideRecordingButton(true) // hidden by default57 .hideAudioModeButton(false)58 .hideRaiseHandButton(false)59 .hideShareInviteButton(true) // hidden by default60 .hideParticipantListButton(false)61 .hideChangeLayoutButton(false)62 .hideChatButton(true) // hidden by default6364 // Notifications65 .enableNotifications(true) // toggle in-session notifications (default true)6667 .build()68```6970### Enum Values Reference7172| Enum | Values |73|------|--------|74| `SessionType` | `VIDEO`, `VOICE` |75| `LayoutType` | `TILE`, `SIDEBAR`, `SPOTLIGHT` |76| `AudioMode` | `SPEAKER`, `EARPIECE`, `BLUETOOTH`, `HEADPHONES` |77| `CameraFacing` | `FRONT`, `REAR` |7879### Common Presets8081**Voice call:**82```kotlin83.setSessionType(SessionType.VOICE)84.setLayout(LayoutType.SPOTLIGHT)85.setAudioMode(AudioMode.EARPIECE)86.startVideoPaused(true)87```8889**Video call:**90```kotlin91.setSessionType(SessionType.VIDEO)92.setLayout(LayoutType.TILE)93.setAudioMode(AudioMode.SPEAKER)94.startVideoPaused(false)95```9697**Custom UI (hide default controls):**98```kotlin99.hideControlPanel(true)100.hideHeaderPanel(true)101```102103### Button Defaults104105| Button | Default Hidden? |106|--------|----------------|107| Recording | Yes (`true`) |108| Share Invite | Yes (`true`) |109| Chat | Yes (`true`) |110| All others | No (`false`) |111112## Gotchas113114- Settings are **immutable** after `build()` — create a new builder for changes115- `SessionType` uses `VOICE` not "AUDIO"116- `LayoutType` values: `TILE`, `SIDEBAR`, `SPOTLIGHT` — all caps117- `setIdleTimeoutPeriod()` takes seconds, default is 300 (5 minutes)118- Recording, share invite, and chat buttons are hidden by default119- These are pre-session configs only; use `CallSession` actions for runtime changes120121## Sample App Reference122123- `CallActivity.kt` — `joinSession()` method builds settings based on voice/video call type