> ## Documentation 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.

# SessionSettingsBuilder

> CometChat Calling SDK v5 - SessionSettingsBuilder for Flutter

The `SessionSettingsBuilder` is a powerful configuration tool that 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, this builder gives you complete control over the call experience.

Proper session configuration is crucial for creating a seamless user experience tailored to your application's specific needs.

<Note>
  These are pre-session configurations that must be set before joining a call. Once configured, pass the `SessionSettings` 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>

```dart theme={null}
final sessionSettings = (SessionSettingsBuilder()
    ..setTitle("Team Meeting")
    ..setDisplayName("John Doe")
    ..setType(SessionType.video)
    ..setLayout(LayoutType.tile)
    ..startAudioMuted(false)
    ..startVideoPaused(false))
  .build();
```

<Warning>
  `CallSettings` and `CallSettingsBuilder` are deprecated and will be removed in a future release. Use `SessionSettings` and `SessionSettingsBuilder` instead. The API is identical — simply replace `CallSettingsBuilder` with `SessionSettingsBuilder` in your code.
</Warning>

## Session Settings

### Title

**Method:** `setTitle(String)`

Sets the title that appears in the call header. This helps participants identify the purpose or name of the call session. The title is displayed prominently at the top of the call interface.

```dart theme={null}
..setTitle("Team Meeting")
```

| Parameter | Type   | Default |
| --------- | ------ | ------- |
| `title`   | String | null    |

### Display Name

**Method:** `setDisplayName(String)`

Sets the display name that will be shown to other participants in the call. This name appears on your video tile and in the participant list, helping others identify you during the session.

```dart theme={null}
..setDisplayName("John Doe")
```

| Parameter     | Type   | Default |
| ------------- | ------ | ------- |
| `displayName` | String | null    |

### Session Type

**Method:** `setType(SessionType)`

Defines the type of call session. Choose `video` for video calls with camera enabled, or `audio` for audio-only calls. This setting determines whether video streaming is enabled by default.

```dart theme={null}
..setType(SessionType.video)
```

| Parameter | Type        | Default |
| --------- | ----------- | ------- |
| `type`    | SessionType | video   |

<Accordion title="SessionType Values">
  | Value               | Description                    |
  | ------------------- | ------------------------------ |
  | `SessionType.video` | Video call with camera enabled |
  | `SessionType.audio` | Audio-only call                |
</Accordion>

### Layout Mode

**Method:** `setLayout(LayoutType)`

Sets the initial layout mode for displaying participants. `tile` shows all participants in a grid, `spotlight` focuses on the active speaker with others in a sidebar, and `sidebar` displays the main speaker with participants in a side panel.

```dart theme={null}
..setLayout(LayoutType.tile)
```

| Parameter | Type       | Default |
| --------- | ---------- | ------- |
| `layout`  | LayoutType | tile    |

<Accordion title="LayoutType Values">
  | Value                  | Description                                    |
  | ---------------------- | ---------------------------------------------- |
  | `LayoutType.tile`      | Grid layout showing all participants equally   |
  | `LayoutType.spotlight` | Focus on active speaker with others in sidebar |
  | `LayoutType.sidebar`   | Main speaker with participants in a sidebar    |
</Accordion>

### Idle Timeout Period

**Method:** `setIdleTimeoutPeriod(int)`

Configures the timeout duration in seconds before automatically ending the session when you're the only participant. This prevents sessions from running indefinitely when others have left.

```dart theme={null}
..setIdleTimeoutPeriod(300)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `seconds` | int  | 300     |

### Start Audio Muted

**Method:** `startAudioMuted(bool)`

Determines whether the microphone is muted when joining the session. Set to `true` to join with audio muted, requiring users to manually unmute. Useful for large meetings to prevent background noise.

```dart theme={null}
..startAudioMuted(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `muted`   | bool | false   |

### Start Video Paused

**Method:** `startVideoPaused(bool)`

Controls whether the camera is turned off when joining the session. Set to `true` to join with video disabled, allowing users to enable it when ready. Helpful for privacy or bandwidth considerations.

```dart theme={null}
..startVideoPaused(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `paused`  | bool | false   |

### Audio Mode

**Method:** `setAudioMode(AudioMode)`

Sets the initial audio output device for the call. Options include `speaker` for loudspeaker, `earpiece` for phone earpiece, or `bluetooth` for connected Bluetooth devices.

```dart theme={null}
..setAudioMode(AudioMode.speaker)
```

| Parameter   | Type      | Default |
| ----------- | --------- | ------- |
| `audioMode` | AudioMode | speaker |

<Accordion title="AudioMode Values">
  | Value                 | Description                |
  | --------------------- | -------------------------- |
  | `AudioMode.speaker`   | Device loudspeaker         |
  | `AudioMode.earpiece`  | Phone earpiece             |
  | `AudioMode.bluetooth` | Connected Bluetooth device |
</Accordion>

### Initial Camera Facing

**Method:** `setInitialCameraFacing(CameraFacing)`

Specifies which camera to use when starting the session. Choose `front` for the front-facing camera (selfie mode) or `rear` for the rear camera. Users can switch cameras during the call.

```dart theme={null}
..setInitialCameraFacing(CameraFacing.front)
```

| Parameter      | Type         | Default |
| -------------- | ------------ | ------- |
| `cameraFacing` | CameraFacing | front   |

<Accordion title="CameraFacing Values">
  | Value                | Description         |
  | -------------------- | ------------------- |
  | `CameraFacing.front` | Front-facing camera |
  | `CameraFacing.rear`  | Rear camera         |
</Accordion>

### Low Bandwidth Mode

**Method:** `enableLowBandwidthMode(bool)`

Enables optimization for poor network conditions. When enabled, the SDK reduces video quality and adjusts streaming parameters to maintain call stability on slow or unstable connections.

```dart theme={null}
..enableLowBandwidthMode(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `enabled` | bool | false   |

### Auto Start Recording

**Method:** `enableAutoStartRecording(bool)`

Automatically starts recording the session as soon as it begins. When enabled, recording starts without manual intervention, ensuring the entire session is captured from the start.

```dart theme={null}
..enableAutoStartRecording(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `enabled` | bool | false   |

### Hide Control Panel

**Method:** `hideControlPanel(bool)`

Hides the bottom control bar that contains call action buttons. Set to `true` to remove the control panel entirely, useful for custom UI implementations or view-only modes.

```dart theme={null}
..hideControlPanel(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | false   |

### Hide Header Panel

**Method:** `hideHeaderPanel(bool)`

Hides the top header bar that displays the call title and session information. Set to `true` to maximize the video viewing area or implement a custom header.

```dart theme={null}
..hideHeaderPanel(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | false   |

### Hide Session Timer

**Method:** `hideSessionTimer(bool)`

Hides the session duration timer that shows how long the call has been active. Set to `true` to remove the timer display from the interface.

```dart theme={null}
..hideSessionTimer(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | false   |

### Hide Leave Session Button

**Method:** `hideLeaveSessionButton(bool)`

Hides the button that allows users to leave or end the call. Set to `true` to remove this button, requiring an alternative method to exit the session.

```dart theme={null}
..hideLeaveSessionButton(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | false   |

### Hide Toggle Audio Button

**Method:** `hideToggleAudioButton(bool)`

Hides the microphone mute/unmute button from the control panel. Set to `true` to remove audio controls, useful when audio control should be managed programmatically.

```dart theme={null}
..hideToggleAudioButton(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | false   |

### Hide Toggle Video Button

**Method:** `hideToggleVideoButton(bool)`

Hides the camera on/off button from the control panel. Set to `true` to remove video controls, useful for audio-only calls or custom video control implementations.

```dart theme={null}
..hideToggleVideoButton(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | false   |

### Hide Switch Camera Button

**Method:** `hideSwitchCameraButton(bool)`

Hides the button that allows switching between front and rear cameras. Set to `true` to remove this control, useful for devices with single cameras or fixed camera requirements.

```dart theme={null}
..hideSwitchCameraButton(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | false   |

### Hide Recording Button

**Method:** `hideRecordingButton(bool)`

Hides the recording start/stop button from the control panel. Set to `false` to show the recording button, allowing users to manually control session recording.

```dart theme={null}
..hideRecordingButton(false)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | true    |

### Hide Screen Sharing Button

**Method:** `hideScreenSharingButton(bool)`

Hides the screen sharing button from the control panel. Set to `true` to remove screen sharing controls, useful when screen sharing is not needed or managed separately.

```dart theme={null}
..hideScreenSharingButton(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | false   |

### Hide Audio Mode Button

**Method:** `hideAudioModeButton(bool)`

Hides the button that toggles between speaker, earpiece, and other audio output modes. Set to `true` to remove audio mode controls from the interface.

```dart theme={null}
..hideAudioModeButton(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | false   |

### Hide Raise Hand Button

**Method:** `hideRaiseHandButton(bool)`

Hides the raise hand button that participants use to signal they want to speak. Set to `true` to remove this feature from the interface.

```dart theme={null}
..hideRaiseHandButton(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | false   |

### Hide Share Invite Button

**Method:** `hideShareInviteButton(bool)`

Hides the button that allows sharing session invite links with others. Set to `false` to show the invite button, enabling easy participant invitation.

```dart theme={null}
..hideShareInviteButton(false)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | true    |

### Hide Participant List Button

**Method:** `hideParticipantListButton(bool)`

Hides the button that opens the participant list view. Set to `true` to remove access to the participant list, useful for simplified interfaces.

```dart theme={null}
..hideParticipantListButton(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | false   |

### Hide Change Layout Button

**Method:** `hideChangeLayoutButton(bool)`

Hides the button that allows switching between different layout modes (tile, spotlight, sidebar). Set to `true` to lock the layout to the initial setting.

```dart theme={null}
..hideChangeLayoutButton(true)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | false   |

### Hide Chat Button

**Method:** `hideChatButton(bool)`

Hides the button that opens the in-call chat interface. Set to `false` to show the chat button, enabling text communication during calls.

```dart theme={null}
..hideChatButton(false)
```

| Parameter | Type | Default |
| --------- | ---- | ------- |
| `hide`    | bool | true    |

<Accordion title="Enum Values">
  | Enum           | Value                  | Description                                    |
  | -------------- | ---------------------- | ---------------------------------------------- |
  | `SessionType`  | `SessionType.video`    | Video call with camera enabled                 |
  |                | `SessionType.audio`    | Audio-only call                                |
  | `LayoutType`   | `LayoutType.tile`      | Grid layout showing all participants equally   |
  |                | `LayoutType.spotlight` | Focus on active speaker with others in sidebar |
  |                | `LayoutType.sidebar`   | Main speaker with participants in a sidebar    |
  | `AudioMode`    | `AudioMode.speaker`    | Device loudspeaker                             |
  |                | `AudioMode.earpiece`   | Phone earpiece                                 |
  |                | `AudioMode.bluetooth`  | Connected Bluetooth device                     |
  | `CameraFacing` | `CameraFacing.front`   | Front-facing camera                            |
  |                | `CameraFacing.rear`    | Rear camera                                    |
</Accordion>
