CallSettingsBuilder class. This allows you to customize the call UI, behavior, and event handling.
CallSettingsBuilder
TheCallSettingsBuilder provides a fluent API to configure call sessions:
Configuration Options
Call Type
| Method | Type | Default | Description |
|---|---|---|---|
setIsAudioOnlyCall(isAudioOnly) | boolean | false | Set to true for audio-only calls |
Layout Mode
| Method | Type | Default | Description |
|---|---|---|---|
setMode(mode) | string | DEFAULT | Call layout mode |
| Mode | Description |
|---|---|
CometChatCalls.CALL_MODE.DEFAULT | Grid layout with all participants visible |
CometChatCalls.CALL_MODE.SPOTLIGHT | Focus on one participant with others in sidebar |
UI Controls
| Method | Type | Default | Description |
|---|---|---|---|
enableDefaultLayout(enabled) | boolean | true | Show/hide the default button layout |
showEndCallButton(show) | boolean | true | Show/hide the end call button |
showMuteAudioButton(show) | boolean | true | Show/hide the mute audio button |
showPauseVideoButton(show) | boolean | true | Show/hide the pause video button |
showSwitchCameraButton(show) | boolean | true | Show/hide the switch camera button |
showAudioModeButton(show) | boolean | true | Show/hide the audio mode button |
showRecordingButton(show) | boolean | false | Show/hide the recording button |
Initial State
| Method | Type | Default | Description |
|---|---|---|---|
startWithAudioMuted(muted) | boolean | false | Start call with audio muted |
startWithVideoMuted(muted) | boolean | false | Start call with video paused |
setDefaultAudioMode(mode) | string | - | Set the default audio output mode |
| Mode | Description |
|---|---|
CometChatCalls.AUDIO_MODE.SPEAKER | Phone speaker |
CometChatCalls.AUDIO_MODE.EARPIECE | Phone earpiece |
CometChatCalls.AUDIO_MODE.BLUETOOTH | Bluetooth device |
CometChatCalls.AUDIO_MODE.HEADPHONES | Wired headphones |
Recording
| Method | Type | Default | Description |
|---|---|---|---|
showRecordingButton(show) | boolean | false | Show/hide the recording button |
startRecordingOnCallStart(start) | boolean | false | Auto-start recording when call begins |
Idle Timeout
| Method | Type | Default | Description |
|---|---|---|---|
setIdleTimeoutPeriod(seconds) | number | 180 | Seconds before auto-ending when alone |
Video Tile Interaction
| Method | Type | Default | Description |
|---|---|---|---|
enableVideoTileClick(enabled) | boolean | true | Enable clicking video tiles in Spotlight mode |
enableVideoTileDrag(enabled) | boolean | true | Enable dragging video tiles in Spotlight mode |
Event Listener
Set up an event listener to handle call events:Complete Example
Related Documentation
- Join Session - Start a call with these settings
- Events - Detailed event documentation
- Actions - Control the call programmatically