Skip to main content
Record call sessions for later playback. Recordings are stored server-side and can be accessed through call logs or the CometChat Dashboard.
Recording must be enabled for your CometChat app. Contact support or check your Dashboard settings if recording is not available.

Start Recording

Start recording during an active call session:
await CallSession.getInstance()?.startRecording();
All participants are notified when recording starts.

Stop Recording

Stop an active recording:
await CallSession.getInstance()?.stopRecording();

Auto-Start Recording

Configure calls to automatically start recording when the session begins:
SessionSettings sessionSettings = CometChatCalls.SessionSettingsBuilder()
    .enableAutoStartRecording(true)
    .build();

Hide Recording Button

Hide the recording button from the default call UI:
SessionSettings sessionSettings = CometChatCalls.SessionSettingsBuilder()
    .hideRecordingButton(true)
    .build();

Listen for Recording Events

Monitor recording state changes using MediaEventsListener:
CallSession? callSession = CallSession.getInstance();

callSession?.addMediaEventsListener(MediaEventsListener(
  onRecordingStarted: () {
    debugPrint("Recording started");
    showRecordingIndicator();
  },
  onRecordingStopped: () {
    debugPrint("Recording stopped");
    hideRecordingIndicator();
  },
  // Other callbacks...
  onAudioMuted: () {},
  onAudioUnMuted: () {},
  onVideoPaused: () {},
  onVideoResumed: () {},
  onScreenShareStarted: () {},
  onScreenShareStopped: () {},
  onAudioModeChanged: (AudioMode audioMode) {},
  onCameraFacingChanged: (CameraFacing facing) {},
));

Track Participant Recording

Monitor when other participants start or stop recording using ParticipantEventListener:
CallSession? callSession = CallSession.getInstance();

callSession?.addParticipantEventListener(ParticipantEventListener(
  onParticipantStartedRecording: (Participant participant) {
    debugPrint("${participant.name} started recording");
  },
  onParticipantStoppedRecording: (Participant participant) {
    debugPrint("${participant.name} stopped recording");
  },
  // Other callbacks...
));

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 to view and download recordings.
  2. Programmatically: Fetch recordings through Call Logs:
CallLogRequest callLogRequest = CallLogRequest.CallLogRequestBuilder()
    .setHasRecording(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

PropertyTypeDescription
ridStringUnique recording identifier
recordingURLStringURL to download/stream the recording
startTimeintTimestamp when recording started
endTimeintTimestamp when recording ended
durationdoubleRecording duration in seconds