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

# Recording

> Use CometChat Calls SDK v5 recording on Flutter to start, stop, access, and manage recordings for supported call sessions.

Record call sessions for later playback. Recordings are stored server-side and can be accessed through call logs or the CometChat Dashboard.

<Warning>
  Recording must be enabled for your CometChat app. Contact support or check your Dashboard settings if recording is not available.
</Warning>

## Start Recording

Start recording during an active call session:

```dart theme={null}
await CallSession.getInstance()?.startRecording();
```

All participants are notified when recording starts.

## Stop Recording

Stop an active recording:

```dart theme={null}
await CallSession.getInstance()?.stopRecording();
```

## Auto-Start Recording

Configure calls to automatically start recording when the session begins:

```dart theme={null}
SessionSettings sessionSettings = SessionSettingsBuilder()
    .enableAutoStartRecording(true)
    .build();
```

<Note>
  **A recording runs until it is stopped.** Whether it was started manually or automatically through `enableAutoStartRecording`, it keeps running until someone stops it. If nobody does, it stops on its own when either:

  * Everyone leaves the session — the recording ends about a minute later.
  * Everyone in the session stays muted for 10 minutes.
</Note>

## Hide Recording Button

Hide the recording button from the default call UI:

```dart theme={null}
SessionSettings sessionSettings = SessionSettingsBuilder()
    .hideRecordingButton(true)
    .build();
```

## Listen for Recording Events

Monitor recording state changes using `MediaEventListeners`:

```dart theme={null}
class _MediaEventListener extends MediaEventListeners {
  @override
  void onRecordingStarted() {
    debugPrint("Recording started");
    showRecordingIndicator();
  }

  @override
  void onRecordingStopped() {
    debugPrint("Recording stopped");
    hideRecordingIndicator();
  }
  // every other callback already defaults to a no-op on the abstract class —
  // override only what you need (onAudioMuted, onAudioUnMuted, onVideoPaused, onVideoResumed, …).
}

CallSession? callSession = CallSession.getInstance();

callSession?.addMediaEventsListener(_MediaEventListener());
```

## Track Participant Recording

Monitor when other participants start or stop recording using `ParticipantEventListeners`:

```dart theme={null}
class _ParticipantEventListener extends ParticipantEventListeners {
  @override
  void onParticipantStartedRecording(Participant participant) {
    debugPrint("${participant.name} started recording");
  }

  @override
  void onParticipantStoppedRecording(Participant participant) {
    debugPrint("${participant.name} stopped recording");
  }
}

CallSession? callSession = CallSession.getInstance();

callSession?.addParticipantEventListener(_ParticipantEventListener());
```

## Access Recordings

Recordings are available after the call ends. You can access them in two ways:

1. **CometChat Dashboard**: Navigate to **Calls > Call Logs** in your [CometChat Dashboard](https://app.cometchat.com) to view and download recordings.

2. **Programmatically**: Fetch recordings through [Call Logs](/calls/flutter/call-logs):

```dart theme={null}
CallLogRequest callLogRequest =
    (CallLogRequestBuilder()..hasRecording = true).build();

callLogRequest.fetchNext(
  onSuccess: (List<CallLog> callLogs) {
    for (CallLog callLog in callLogs) {
      callLog.recordings?.forEach((recording) {
        debugPrint("Recording URL: ${recording.recordingUrl}");
        debugPrint("Duration: ${recording.duration} seconds");
        debugPrint("Start Time: ${recording.startTime}");
        debugPrint("End Time: ${recording.endTime}");
      });
    }
  },
  onError: (CometChatCallsException e) {
    debugPrint("Error: ${e.message}");
  },
);
```

## Recording Object

| Property       | Type   | Description                          |
| -------------- | ------ | ------------------------------------ |
| `rid`          | String | Unique recording identifier          |
| `recordingUrl` | String | URL to download/stream the recording |
| `startTime`    | int    | Timestamp when recording started     |
| `endTime`      | int    | Timestamp when recording ended       |
| `duration`     | double | Recording duration in seconds        |
