ParticipantEventListener

Receives events for one participant. Register with Participant.addEventListener.

Every method has an empty body, so an implementation overrides only the events it needs. Callbacks arrive on the main thread, except for the onStreamEnabled replay that Participant.addEventListener performs on the registering thread.

An override that throws is swallowed; the remaining listeners still run.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun onAgentMetrics(metrics: JSONObject)

Called after each conversational turn with the agent's own timings, model choices and the text of the turn. Register it on an AgentParticipant, like onAgentTranscriptionReceived.

Link copied to clipboard
open fun onAgentStateChanged(agentState: AgentState)

Called when an AI agent moves between listening, thinking and speaking — drive the agent's on-screen indicator from this.

Link copied to clipboard
open fun onAgentTranscriptionReceived(transcription: TranscriptionSegment, participant: Participant)

Called with each transcript segment produced while an AI agent is in the room, covering what the agent heard as well as what it said.

Link copied to clipboard
open fun onE2EEStateChanged(state: E2EEState, stream: RTCStream)

Called when end-to-end encryption starts working or fails on one of this participant's streams.

Link copied to clipboard
open fun onMediaStatusChanged(participantId: String, kind: MediaType, newStatus: Boolean)

Called when this participant turns their microphone, camera or screen share on or off, whether or not this device receives it. Fired on the main thread.

Link copied to clipboard
open fun onStreamDisabled(stream: RTCStream)

Called when this participant stops publishing a track — they muted, turned the camera off, or stopped sharing. Drop any view bound to it.

Link copied to clipboard
open fun onStreamEnabled(stream: RTCStream)

Called when this participant starts publishing a track — their camera, microphone or screen share. This is where a tile gets something to render.

Link copied to clipboard
open fun onStreamPaused(kind: StreamKind?, reason: String)

Called when delivery of one of this participant's streams is suspended — by RTCStream.pause here, or by the server shedding it.

Link copied to clipboard
open fun onStreamResumed(kind: StreamKind?, reason: String)

Called when a paused stream from this participant is flowing again.