Quick Reference for AI Agents & Developers
Overview
Presenter Mode enables:- Up to 5 presenters sharing video, audio, and/or screen
- Up to 100 total participants (presenters + viewers)
- Viewers consume content without sending their own streams
- Presenters have full control over mute, camera, recording, etc.
Use Cases
- All-hands meetings
- Keynote presentations
- Webinars
- Online classes
- Talk shows
- Product demos
Prerequisites
Before implementing Presenter Mode:- Complete the Calls SDK Setup
- Generate a call token using generateToken()
User Types
| Type | Can Send Media | Can Receive Media | Controls |
|---|---|---|---|
| Presenter | ✅ Video, Audio, Screen | ✅ | Full (mute, camera, recording) |
| Viewer | ❌ | ✅ | Limited (volume only) |
Start Presentation
UsePresentationSettingsBuilder to configure and join a presentation:
- Presenter (JavaScript)
- Viewer (JavaScript)
- TypeScript
Presentation Settings
| Method | Description | Default |
|---|---|---|
setIsPresenter(boolean) | true = presenter, false = viewer | - |
enableDefaultLayout(boolean) | Show/hide default UI controls | true |
showEndCallButton(boolean) | Show end call button | true |
showPauseVideoButton(boolean) | Show pause video button (presenter only) | true |
showMuteAudioButton(boolean) | Show mute audio button (presenter only) | true |
showSwitchCameraButton(boolean) | Show camera switch button (presenter only) | true |
showAudioModeButton(boolean) | Show audio mode selector | true |
setIsAudioOnlyCall(boolean) | Audio-only presentation | false |
startWithAudioMuted(boolean) | Start with mic muted | false |
startWithVideoMuted(boolean) | Start with camera off | false |
showRecordingButton(boolean) | Show recording button (presenter only) | false |
setDefaultAudioMode(string) | Default audio output mode | - |
Audio Modes
Available audio output modes:CometChatCalls.AUDIO_MODE.SPEAKERCometChatCalls.AUDIO_MODE.EARPIECECometChatCalls.AUDIO_MODE.BLUETOOTHCometChatCalls.AUDIO_MODE.HEADPHONES
Event Listeners
Register listeners to handle presentation events:- JavaScript
- TypeScript
Adding/Removing Listeners
You can add multiple listeners and remove them by ID:- JavaScript
- TypeScript
Event Reference
| Event | Description |
|---|---|
onCallEnded() | Presentation ended |
onCallEndButtonPressed() | User clicked end button |
onUserJoined(user) | Participant joined |
onUserLeft(user) | Participant left |
onUserListUpdated(users) | Participant list changed |
onAudioModesUpdated(devices) | Audio devices changed |
onUserMuted(event) | User mute state changed |
onRecordingStarted(user) | Recording started |
onRecordingStopped(user) | Recording stopped |
onError(error) | Error occurred |
Complete Example
- JavaScript