Quick Reference for AI Agents & Developers// Enable recording in call settings
const callSettings = new CometChatCalls.CallSettingsBuilder()
.showRecordingButton(true) // Show recording button in UI
.startRecordingOnCallStart(true) // Auto-start recording
.setCallListener(new CometChatCalls.OngoingCallListener({
onRecordingStarted: (event) => console.log("Recording started"),
onRecordingStopped: (event) => console.log("Recording stopped")
}))
.build();
// Manual recording control
CometChatCalls.startRecording();
CometChatCalls.stopRecording();
// Access recordings: Dashboard > Calls > View Recordings
Available via: SDK | Dashboard
Record your voice and video calls for playback, compliance, training, or archival purposes.
Prerequisites
Before implementing recording, ensure you have:
- Completed the Calls SDK Setup
- Implemented either Ringing or Call Session calling
Implementation
Add recording listeners to your call settings to receive recording state updates:
const callListener = new CometChatCalls.OngoingCallListener({
onRecordingStarted: (event) => {
console.log("Recording started by:", event.user.getName());
// Update UI to show recording indicator
},
onRecordingStopped: (event) => {
console.log("Recording stopped by:", event.user.getName());
// Update UI to hide recording indicator
},
// ... other listeners
});
const callSettings = new CometChatCalls.CallSettingsBuilder()
.enableDefaultLayout(true)
.setIsAudioOnlyCall(false)
.showRecordingButton(true) // Show recording button in UI
.setCallListener(callListener)
.build();
const htmlElement = document.getElementById("call-container");
CometChatCalls.startSession(callToken, callSettings, htmlElement);
const callListener = new CometChatCalls.OngoingCallListener({
onRecordingStarted: (event: any) => {
console.log("Recording started by:", event.user.getName());
},
onRecordingStopped: (event: any) => {
console.log("Recording stopped by:", event.user.getName());
},
// ... other listeners
});
const callSettings = new CometChatCalls.CallSettingsBuilder()
.enableDefaultLayout(true)
.setIsAudioOnlyCall(false)
.showRecordingButton(true)
.setCallListener(callListener)
.build();
const htmlElement = document.getElementById("call-container") as HTMLElement;
CometChatCalls.startSession(callToken, callSettings, htmlElement);
Recording Settings
Configure recording behavior using CallSettingsBuilder:
| Method | Description | Default |
|---|
showRecordingButton(boolean) | Show/hide the recording button in the call UI | false |
startRecordingOnCallStart(boolean) | Automatically start recording when call begins | false |
const callSettings = new CometChatCalls.CallSettingsBuilder()
.enableDefaultLayout(true)
.showRecordingButton(true) // Show recording button
.startRecordingOnCallStart(true) // Auto-start recording
.setCallListener(callListener)
.build();
const callSettings = new CometChatCalls.CallSettingsBuilder()
.enableDefaultLayout(true)
.showRecordingButton(true)
.startRecordingOnCallStart(true)
.setCallListener(callListener)
.build();
Manual Recording Control
For custom UI implementations, use these methods to control recording programmatically:
Start Recording
CometChatCalls.startRecording();
CometChatCalls.startRecording();
Stop Recording
CometChatCalls.stopRecording();
CometChatCalls.stopRecording();
Accessing Recordings
Recordings are available in the CometChat Dashboard:
Navigate to Calls
Go to the Calls section in your dashboard
Find the Call
Locate the call you want to access recordings for
View Recordings
Click the three-dot menu icon and select “View Recordings”
Next Steps