> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-rn-guide-message-privately.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Session Settings

> Configure CometChat Calls SDK v5 session settings on JavaScript for call behavior, UI options, participant controls, and features.

The session settings object allows you to customize every aspect of your call session before participants join. From controlling the initial audio/video state to customizing the UI layout and hiding specific controls, these settings give you complete control over the call experience.

<Note>
  These are pre-session configurations that must be set before joining a call. Once configured, pass the settings object to the `joinSession()` method. Settings cannot be changed after the session has started, though many features can be controlled dynamically during the call using call actions.
</Note>

```javascript theme={null}
const callSettings = {
  sessionType: "VIDEO",
  layout: "TILE",
  startAudioMuted: false,
  startVideoPaused: false,
  hideControlPanel: false,
  hideLeaveSessionButton: false,
  hideToggleAudioButton: false,
  hideToggleVideoButton: false,
};
```

## Session Settings

### Session Type

**Property:** `sessionType`

Defines the type of call session. Choose `VIDEO` for video calls with camera enabled, or `VOICE` for audio-only calls.

```javascript theme={null}
sessionType: "VIDEO"
```

| Value   | Description                    |
| ------- | ------------------------------ |
| `VIDEO` | Video call with camera enabled |
| `VOICE` | Audio-only call                |

**Default:** `VIDEO`

### Layout Mode

**Property:** `layout`

Sets the initial layout mode for displaying participants.

```javascript theme={null}
layout: "TILE"
```

| Value       | Description                                    |
| ----------- | ---------------------------------------------- |
| `TILE`      | Grid layout showing all participants equally   |
| `SIDEBAR`   | Main speaker with participants in a sidebar    |
| `SPOTLIGHT` | Focus on active speaker with others in sidebar |

**Default:** `TILE`

### Start Audio Muted

**Property:** `startAudioMuted`

Determines whether the microphone is muted when joining the session.

```javascript theme={null}
startAudioMuted: true
```

**Default:** `false`

### Start Video Paused

**Property:** `startVideoPaused`

Controls whether the camera is turned off when joining the session.

```javascript theme={null}
startVideoPaused: true
```

**Default:** `false`

### Auto Start Recording

**Property:** `autoStartRecording`

Automatically starts recording the session as soon as it begins.

```javascript theme={null}
autoStartRecording: true
```

**Default:** `false`

### Idle Timeout Period Before Prompt

**Property:** `idleTimeoutPeriodBeforePrompt`

Time in milliseconds before showing the idle timeout prompt when you're the only participant.

```javascript theme={null}
idleTimeoutPeriodBeforePrompt: 60000 // 60 seconds
```

**Default:** `60000` (60 seconds)

### Idle Timeout Period After Prompt

**Property:** `idleTimeoutPeriodAfterPrompt`

Time in milliseconds after the prompt before automatically ending the session.

```javascript theme={null}
idleTimeoutPeriodAfterPrompt: 120000 // 120 seconds
```

**Default:** `120000` (120 seconds)

## UI Visibility Settings

### Hide Control Panel

**Property:** `hideControlPanel`

Hides the bottom control bar that contains call action buttons.

```javascript theme={null}
hideControlPanel: true
```

**Default:** `false`

### Hide Leave Session Button

**Property:** `hideLeaveSessionButton`

Hides the button that allows users to leave or end the call.

```javascript theme={null}
hideLeaveSessionButton: true
```

**Default:** `false`

### Hide Toggle Audio Button

**Property:** `hideToggleAudioButton`

Hides the microphone mute/unmute button from the control panel.

```javascript theme={null}
hideToggleAudioButton: true
```

**Default:** `false`

### Hide Toggle Video Button

**Property:** `hideToggleVideoButton`

Hides the camera on/off button from the control panel.

```javascript theme={null}
hideToggleVideoButton: true
```

**Default:** `false`

### Hide Recording Button

**Property:** `hideRecordingButton`

Hides the recording start/stop button from the control panel.

```javascript theme={null}
hideRecordingButton: false
```

**Default:** `true`

### Hide Screen Sharing Button

**Property:** `hideScreenSharingButton`

Hides the screen sharing button from the control panel.

```javascript theme={null}
hideScreenSharingButton: true
```

**Default:** `false`

### Hide Change Layout Button

**Property:** `hideChangeLayoutButton`

Hides the button that allows switching between different layout modes.

```javascript theme={null}
hideChangeLayoutButton: true
```

**Default:** `false`

### Hide Switch Layout Button

**Property:** `hideSwitchLayoutButton`

Hides the layout switch button.

```javascript theme={null}
hideSwitchLayoutButton: true
```

**Default:** `false`

### Hide Virtual Background Button

**Property:** `hideVirtualBackgroundButton`

Hides the virtual background settings button.

```javascript theme={null}
hideVirtualBackgroundButton: true
```

**Default:** `false`

### Hide Network Indicator

**Property:** `hideNetworkIndicator`

Hides the network quality indicator.

```javascript theme={null}
hideNetworkIndicator: true
```

**Default:** `false`

## Complete Example

```javascript theme={null}
const callSettings = {
  // Session configuration
  sessionType: "VIDEO",
  layout: "TILE",
  startAudioMuted: false,
  startVideoPaused: false,
  autoStartRecording: false,
  
  // Timeout settings
  idleTimeoutPeriodBeforePrompt: 60000,
  idleTimeoutPeriodAfterPrompt: 120000,
  
  // UI visibility
  hideControlPanel: false,
  hideLeaveSessionButton: false,
  hideToggleAudioButton: false,
  hideToggleVideoButton: false,
  hideRecordingButton: true,
  hideScreenSharingButton: false,
  hideChangeLayoutButton: false,
  hideVirtualBackgroundButton: false,
  hideNetworkIndicator: false,
};
```

<Accordion title="All Settings Reference">
  | Property                        | Type    | Default  | Description                               |
  | ------------------------------- | ------- | -------- | ----------------------------------------- |
  | `sessionType`                   | String  | `VIDEO`  | Call type: `VIDEO` or `VOICE`             |
  | `layout`                        | String  | `TILE`   | Layout: `TILE`, `SIDEBAR`, or `SPOTLIGHT` |
  | `startAudioMuted`               | Boolean | `false`  | Start with microphone muted               |
  | `startVideoPaused`              | Boolean | `false`  | Start with camera off                     |
  | `autoStartRecording`            | Boolean | `false`  | Auto-start recording                      |
  | `idleTimeoutPeriodBeforePrompt` | Number  | `60000`  | Idle timeout before prompt (ms)           |
  | `idleTimeoutPeriodAfterPrompt`  | Number  | `120000` | Idle timeout after prompt (ms)            |
  | `hideControlPanel`              | Boolean | `false`  | Hide control panel                        |
  | `hideLeaveSessionButton`        | Boolean | `false`  | Hide leave button                         |
  | `hideToggleAudioButton`         | Boolean | `false`  | Hide audio toggle                         |
  | `hideToggleVideoButton`         | Boolean | `false`  | Hide video toggle                         |
  | `hideRecordingButton`           | Boolean | `true`   | Hide recording button                     |
  | `hideScreenSharingButton`       | Boolean | `false`  | Hide screen share button                  |
  | `hideChangeLayoutButton`        | Boolean | `false`  | Hide layout change button                 |
  | `hideSwitchLayoutButton`        | Boolean | `false`  | Hide layout switch button                 |
  | `hideVirtualBackgroundButton`   | Boolean | `false`  | Hide virtual background button            |
  | `hideNetworkIndicator`          | Boolean | `false`  | Hide network indicator                    |
</Accordion>
