CometChatCalls class during an active call session. The session object that CometChatCalls.initiateCall, connect and getActiveSession() return has every action as a method too (session.muteAudio(), session.setLayout(...), and so on); on the session object an action called while no session is live is ignored with a console warning.
Audio Controls
Mute Audio
Mutes your local microphone, stopping audio transmission to other participants.Unmute Audio
Unmutes your local microphone, resuming audio transmission.Video Controls
Pause Video
Turns off your local camera, stopping video transmission. Other participants see your avatar.Resume Video
Turns on your local camera, resuming video transmission.Switch Camera
Toggles between front and back cameras (on supported devices).Screen Sharing
Start Screen Sharing
Begins sharing your screen with other participants. The browser will prompt the user to select which screen, window, or tab to share.Stop Screen Sharing
Stops the current screen share.Recording
Start Recording
Begins server-side recording of the call. All participants are notified.Stop Recording
Stops the current recording. The recording is saved and accessible via the dashboard.Transcription
Available since v5.0.5Start Transcription
Begins server-side transcription of the call. This also enables the live closed captions overlay.Stop Transcription
Stops the current transcription and clears any captions currently on screen. The transcript is saved and can be retrieved withTranscriptRequestBuilder.
Participant Management
Mute Participant
Mutes a specific participant’s audio. This is a moderator action.Pause Participant Video
Pauses a specific participant’s video. This is a moderator action.Pin Participant
Pins a participant to keep them prominently displayed regardless of who is speaking.Unpin Participant
Removes the pin, returning to automatic speaker highlighting.Layout
Set Layout
Changes the call layout. Each participant can choose their own layout independently.Raise Hand
Raise Hand
Shows a hand-raised indicator to get attention from other participants.Lower Hand
Removes the hand-raised indicator.Session Control
Leave Session
Ends your participation and disconnects gracefully. In a 1:1 call this is the hang-up: the other side receivesonParticipantLeft, and a session joined as a peer call (isPeerCall: true) ends for both. In a group call the session continues for the other participants. Leaving also cancels a session that is only prepared: onConnectionClosed fires instead of onSessionLeft. A prepared peer session is already in the room, so leaving it ends the room for everyone in it, as a hang-up would.
leaveSession() takes no session ID. CometChatCalls is a singleton that tracks one active session at a time, so this leaves whichever session is currently in progress. The same applies to every action on this page. See Single Active Session.
To end a call that is still ringing, use
CometChatCalls.endCall(sessionId, status) instead: "cancelled" on the caller, "rejected" or "busy" on the callee, as described in Ringing. leaveSession() alone does not tell the other side why the call ended.Session State
session.isSessionActive() returns true while the SDK owns a session: one being prepared or prepared (for example an outgoing call that is still ringing), one being joined, or a joined one. session.isSessionJoined() is the narrower “in a call” check: true only once the session is joined. CometChatCalls.getSessionState() returns "idle", "preparing", "prepared", "joining" or "joined".
Get Participants
Returns a snapshot of the remote participants of the session, the same listonParticipantListChanged receives. The local user is not in it.