Events enum

Every event the SDK emits.

Listen with room.on(...). The Room delivers room, participant, stream, recording, streaming, transcription and messaging events. An AgentParticipant delivers its own events (agentStateChanged, agentTranscriptionReceived, agentMetrics) on its own on().

Example

room.on(Events.roomJoined, () {
  print('Room joined successfully');
});

room.on(Events.participantJoined, (Participant participant) {
  print('Participant joined: ${participant.displayName}');
});

Handler parameters

A handler may declare fewer parameters than an event provides and receives the first ones, so room.on(Events.roomLeft, () {}) and room.on(Events.roomLeft, (LeaveReason? reason) {}) are both valid. Declaring more parameters, or a type the event does not deliver, throws when the event fires. Each event lists exactly what it delivers.

Inheritance
Available extensions

Values

roomJoined → const Events

Emitted when the local participant successfully joins the room.

Also emitted after Room.switchTo lands in the new room. Only then does it deliver an argument: a Map with switchRoomId, the id of the room switched to.

Example

room.on(Events.roomJoined, () {
  print('Successfully joined the room!');
});
roomLeft → const Events

Emitted when the local participant leaves the room.

  • This event is triggered whenever the local participant exits the room, either voluntarily or due to an error or system action.

  • After this event the Room releases itself: every handler is removed and it cannot be joined again. Create a new Room to rejoin.

  • The event callback provides an optional LeaveReason parameter that describes why the participant left the room.

Event callback parameters

  • reason (LeaveReason?): Indicates the reason for leaving the room. Possible values include:

    • LeaveReason.WEBSOCKET_DISCONNECTED Socket disconnected.

    • LeaveReason.REMOVE_PEER Participant was removed from the room.

    • LeaveReason.REMOVE_PEER_VIEWER_MODE_CHANGED Participant was removed because viewer mode was changed.

    • LeaveReason.REMOVE_PEER_MEDIA_RELAY_STOP Participant was removed because media relay was stopped.

    • LeaveReason.SWITCH_ROOM Participant switched to a different room.

    • LeaveReason.ROOM_CLOSE The room has been closed.

    • LeaveReason.UNKNOWN Participant disconnected due to an unknown reason.

    • LeaveReason.REMOVE_ALL All participants were removed from the room.

    • LeaveReason.MEETING_END_API Room was ended using the Meeting End API.

    • LeaveReason.REMOVE_PEER_API Participant was removed using the Remove Participant API.

    • LeaveReason.DUPLICATE_PARTICIPANT The same participant id joined from another device.

    • LeaveReason.MANUAL_LEAVE_CALLED Participant manually called the leave() method.

    • LeaveReason.WEBSOCKET_CONNECTION_ATTEMPTS_EXHAUSTED Room left after multiple failed WebSocket connection attempts.

    • LeaveReason.JOIN_ROOM_FAILED Room left due to an error while joining the room.

    • LeaveReason.SWITCH_ROOM_FAILED Room left due to an error while switching rooms.

Example

room.on(Events.roomLeft, (LeaveReason? reason) {
  if (reason != null) {
    print(
      'Left room due to ${reason.name} '
      '(code: ${reason.code}, message: ${reason.message})',
    );
  } else {
    print('Left room');
  }
});
roomStateChanged → const Events

Emitted whenever the room’s connection state changes.

  • This event is triggered on any change in the room’s lifecycle state, such as connecting, connected, reconnecting, disconnected or failed.

  • The current RoomState is passed as a callback parameter.

Event callback parameters

  • roomState (RoomState): Represents the current connection state of the room. Possible values:
    • RoomState.CONNECTING
    • RoomState.CONNECTED
    • RoomState.RECONNECTING
    • RoomState.DISCONNECTED
    • RoomState.FAILED — the connection failed and will not be retried.

Example

room.on(Events.roomStateChanged, (RoomState roomState) {
  switch (roomState) {
    case RoomState.CONNECTING:
      print('Room is connecting');
      break;
    case RoomState.CONNECTED:
      print('Room is connected');
      break;
    case RoomState.DISCONNECTED:
      print('Room disconnected abruptly');
      break;
    case RoomState.RECONNECTING:
      print('Room is reconnecting');
      break;
    case RoomState.FAILED:
      print('Room connection failed');
      break;
  }
});
entryRequested → const Events

Emitted when a participant requests permission to join the room.

  • This event is triggered when a new participant attempts to join the room with the ask_join permission enabled in their token.

  • The event is emitted only to participants who have the allow_join permission in their token.

  • The event callback provides a Map<String, dynamic> containing the participant details along with allow() and deny() actions to either approve or reject the entry request.

Event callback parameters

  • data (Map<String, dynamic>): A map containing the following keys:

    • participantId (String): The unique ID of the participant requesting to join.

    • name (String): The display name of the participant requesting to join.

    • allow (Function): Call this function to approve the participant’s entry request.

    • deny (Function): Call this function to reject the participant’s entry request.

Example

room.on(Events.entryRequested, (Map<String, dynamic> data) {
  final String participantId = data['participantId'];
  final String name = data['name'];

  final Function allow = data['allow'];
  final Function deny = data['deny'];

  print('$name requested to join the room');

  // Allow the participant to join
  allow();

  // Or deny the participant's entry request
  // deny();
});
entryResponded → const Events

Emitted when a participant’s entry request receives a response.

  • This event is triggered after a join() request is either approved or denied.

The event is emitted to:

  • All participants who have the allow_join permission in their token
  • The participant who originally requested to join the room

Event callback parameters

  • data (Map<String, dynamic>):
    • participantId (String): the participant who requested to join.
    • decision (String): "allowed" or "denied".

Example

room.on(Events.entryResponded, (Map<String, dynamic> data) {
  final String participantId = data['participantId'];
  if (data['decision'] == 'allowed') {
    print('Entry request allowed for participant: $participantId');
  } else {
    print('Entry request denied for participant: $participantId');
  }
});
micRequested → const Events

Emitted when a participant requests permission to enable the microphone of another participant.

  • This event is emitted to participant B when another participant A requests to enable participant B’s microphone.

  • If the request is accepted, the microphone of participant B will be enabled.

Event callback parameters

  • data (Map<String, dynamic>): A map containing the following keys:

    • participantId (String): who sent the request.

    • accept (Function): Call this function to approve the microphone enable request.

    • reject (Function): Call this function to reject the microphone enable request.

Example

room.on(Events.micRequested, (Map<String, dynamic> data) {
  final Function accept = data['accept'];
  final Function reject = data['reject'];

  // Accept the microphone enable request
  accept();

  // Or reject the request
  // reject();
});
cameraRequested → const Events

Emitted when a participant requests permission to enable the camera of another participant.

  • This event is emitted to participant B when another participant A requests to enable participant B’s camera.

  • If the request is accepted, the camera of participant B will be enabled.

Event callback parameters

  • data (Map<String, dynamic>): A map containing the following keys:

    • participantId (String): who sent the request.

    • accept (Function): Call this function to approve the camera enable request.

    • reject (Function): Call this function to reject the camera enable request.

Example

room.on(Events.cameraRequested, (Map<String, dynamic> data) {
  final Function accept = data['accept'];
  final Function reject = data['reject'];

  // Accept the camera enable request
  accept();

  // Or reject the request
  // reject();
});
participantJoined → const Events

Emitted when a new participant joins the room.

  • This event is triggered whenever a remote participant successfully joins the room. The newly joined participant is provided as a Participant object in the event callback.

Event callback parameters

  • participant (Participant): The participant who has joined the room.

Example

room.on(Events.participantJoined, (Participant participant) {
  print('Participant joined: ${participant.displayName}');
});
participantLeft → const Events

Emitted when a remote participant leaves the room.

  • This event is triggered whenever a participant who had joined the room leaves it, either voluntarily or due to an error or system action.

  • The event callback provides the Participant who left along with a LeaveReason describing why.

Event callback parameters

  • participant (Participant): The participant who left the room.

  • reason (LeaveReason): Indicates the reason why the participant left the room. Possible values include:

    • LeaveReason.WEBSOCKET_DISCONNECTED
    • LeaveReason.REMOVE_PEER
    • LeaveReason.REMOVE_PEER_VIEWER_MODE_CHANGED
    • LeaveReason.REMOVE_PEER_MEDIA_RELAY_STOP
    • LeaveReason.SWITCH_ROOM
    • LeaveReason.ROOM_CLOSE
    • LeaveReason.UNKNOWN
    • LeaveReason.REMOVE_ALL
    • LeaveReason.MEETING_END_API
    • LeaveReason.REMOVE_PEER_API
    • LeaveReason.DUPLICATE_PARTICIPANT
    • LeaveReason.MANUAL_LEAVE_CALLED
    • LeaveReason.WEBSOCKET_CONNECTION_ATTEMPTS_EXHAUSTED
    • LeaveReason.JOIN_ROOM_FAILED
    • LeaveReason.SWITCH_ROOM_FAILED

Example

room.on(
  Events.participantLeft,
  (Participant participant, LeaveReason reason) {
    print(
      'Participant ${participant.id} left the room '
      '(code: ${reason.code}, message: ${reason.message})',
    );
  },
);
pinStateChanged → const Events

Emitted when a participant’s pin state changes.

  • This event is triggered whenever a participant is pinned or unpinned in the room, either for camera, screen share, or both.

  • The event callback receives a Map<String, dynamic> containing details about the pin state change.

Event callback parameters

  • data (Map<String, dynamic>):
    • participantId (String): The ID of the participant whose pin state has changed.

    • state (ParticipantPinState): whether the camera and the screen share are pinned.

    • pinnedBy (String): The participant ID of the user who performed the pin or unpin action.

Example

room.on(Events.pinStateChanged, (Map<String, dynamic> data) {
  final String participantId = data['participantId'];
  final ParticipantPinState state = data['state'];
  final String pinnedBy = data['pinnedBy'];

  print(
    'Participant $participantId pin state changed '
    '(cam: ${state.cam}, share: ${state.share}) by $pinnedBy',
  );
});
participantModeChanged → const Events

Emitted when a participant’s mode changes.

  • This event is triggered whenever a participant switches their mode, such as moving between sending/receiving media, signaling-only, or receive-only mode.

Event callback parameters

  • data (Map<String, dynamic>):
    • participantId (String): The ID of the participant whose mode has changed.
    • mode (Mode): The updated mode of the participant.

Example

room.on(Events.participantModeChanged, (Map<String, dynamic> data) {
  final String participantId = data['participantId'];
  final Mode mode = data['mode'];

  print('Participant $participantId changed mode to $mode');
});
speakerChanged → const Events

Emitted when the active speaker in the room changes.

  • This event is triggered whenever the currently active speaker changes. It can be used to track which participant is speaking at any given time.

  • If no participant is actively speaking, the callback parameter will be null.

Event callback parameters

  • activeSpeakerId (String?): The participant ID of the currently active speaker, or null if no participant is speaking.

Example

room.on(Events.speakerChanged, (String? activeSpeakerId) {
  if (activeSpeakerId != null) {
    print('Active speaker ID: $activeSpeakerId');
  } else {
    print('No active speaker');
  }
});
presenterChanged → const Events

Emitted when the active presenter (screen-sharing participant) changes.

  • This event is triggered when a participant starts or stops screen sharing. It provides the participant ID of the active presenter.

  • If screen sharing is stopped and no participant is presenting, the callback parameter will be null.

Event callback parameters

  • presenterId (String?): The participant ID of the active presenter, or null if no participant is currently sharing their screen.

Example

room.on(Events.presenterChanged, (String? presenterId) {
  if (presenterId != null) {
    print('Active presenter ID: $presenterId');
  } else {
    print('No active presenter');
  }
});
streamEnabled → const Events

Emitted when a media stream is enabled for a participant.

This event is triggered when a participant starts producing or consuming a media stream of any type, such as:

  • audio

  • video

  • screen share

  • The enabled RTCStream object is passed as the callback parameter.

Event callback parameters

  • stream (RTCStream): The media stream that has been enabled.

Example

room.on(Events.streamEnabled, (RTCStream stream) {
  final participantId = stream.participantId;
  print('${stream.kind} stream enabled for $participantId');
});
streamDisabled → const Events

Emitted when a media stream is disabled for a participant.

This event is triggered when a participant stops producing or consuming a media stream of any type, such as:

  • audio

  • video

  • screen share

  • The disabled RTCStream object is passed as the callback parameter.

Event callback parameters

  • stream (RTCStream): The media stream that has been disabled.

Example

room.on(Events.streamDisabled, (RTCStream stream) {
  final participantId = stream.participantId;
  print('${stream.kind} stream disabled for $participantId');
});
streamPaused → const Events

Emitted when a stream you receive is paused.

Event callback parameters

  • kind (String?): audio, video or share.
  • reason (String?): why it was paused, as the server reports it.

The room's event does not say whose stream it was; the same event on that Participant (participant.on(...)) does.

Example

room.on(Events.streamPaused, (String? kind, String? reason) {
  print('A $kind stream was paused: $reason');
});
streamResumed → const Events

Emitted when a paused stream you receive is resumed.

Event callback parameters

  • kind (String?): audio, video or share.
  • reason (String?): why it was resumed, as the server reports it.

The room's event does not say whose stream it was; the same event on that Participant (participant.on(...)) does.

Example

room.on(Events.streamResumed, (String? kind, String? reason) {
  print('A $kind stream was resumed: $reason');
});
streamStateChanged → const Events

Emitted on a RTCStream when the health of a remote participant’s video or screen-share stream changes. Subscribe with stream.on, not room.on.

The handler receives the StreamState and a timestamp in milliseconds.

Example

stream.on(Events.streamStateChanged, (StreamState state, int timestamp) {
  print('${stream.kind.name} is now $state');
});
videoQualityChanged → const Events

Emitted when a participant’s video quality changes.

Not delivered in this release. The Android and iOS SDKs this version runs on do not report quality changes, so no handler receives this event.

codecChanged → const Events
  • Triggered when the room's active media codec changes because a newly joined participant does not support the current codec.

  • The room automatically negotiates and switches to a mutually compatible codec to maintain connectivity for all participants.

Event callback parameters

  • data (CodecChangeInfo):
    • unsupportedRemoteCodec (VideoCodec): The codec that the newly joined participant did not support, which triggered the switch.
    • currentCodec (VideoCodec): The new codec that the room switched to after the change.
    • previousCodec (VideoCodec): The codec that was in use before the change.
    • kind (String): The media type for which the codec changed.
    • causedBy (Participant?): The Participant instance of the participant whose joining triggered the codec change.

Example

room.on(Events.codecChanged, (CodecChangeInfo data) {
  final unsupportedRemoteCodec = data.unsupportedRemoteCodec;
  final currentCodec = data.currentCodec;
  final previousCodec = data.previousCodec;
  final kind = data.kind;
  final causedBy = data.causedBy;
});
qualityLimitation → const Events

Emitted when a quality limitation is detected or resolved during the room.

  • This event is triggered when the SDK applies or removes limitations on media quality due to factors such as network conditions or device performance.

Limitation types

  • CONGESTION: Network congestion detected.
  • BANDWIDTH: Insufficient available bandwidth.
  • CPU: High CPU usage on the device.

Limitation states

  • DETECTED: A quality limitation has been detected.
  • RESOLVED: The previously detected limitation has been resolved.

Event callback parameters

  • type (String): The type of quality limitation (CONGESTION, BANDWIDTH, or CPU).

  • state (String): The current state of the limitation (DETECTED or RESOLVED).

  • timestamp (int?): When the limitation changed, in ms since epoch.

Example

room.on(Events.qualityLimitation,
    (String type, String state, int? timestamp) {
  print('Quality limitation [$type] was $state at $timestamp');
});
recordingStarted → const Events

Emitted when room recording starts.

Prefer Events.recordingStateChanged, which reports every recording state, including this one.

Example

room.on(Events.recordingStarted, () {
  print('Recording has started');
});
recordingStopped → const Events

Emitted when room recording stops.

Prefer Events.recordingStateChanged, which reports every recording state, including this one.

Example

room.on(Events.recordingStopped, () {
  print('Recording has stopped');
});
recordingStateChanged → const Events

Emitted when the room’s recording state changes.

-This event is triggered whenever the recording lifecycle transitions between different states, such as starting, started, stopping, or stopped.

Possible recording states

  • RECORDING_STARTING: Recording is initializing and has not started yet.

  • RECORDING_STARTED: Recording has started successfully.

  • RECORDING_STOPPING: Recording is in the process of stopping.

  • RECORDING_STOPPED: Recording has stopped successfully.

Event callback parameters

  • state (String): The current recording state.

Example

room.on(Events.recordingStateChanged, (String state) {
  print('Room recording state: $state');
});
livestreamStarted → const Events

Emitted when RTMP live streaming starts.

Prefer Events.onLivestreamStateChanged, which reports every livestream state, including this one.

Example

room.on(Events.livestreamStarted, () {
  print('Live streaming has started');
});
livestreamStopped → const Events

Emitted when RTMP live streaming stops.

Prefer Events.onLivestreamStateChanged, which reports every livestream state, including this one.

Example

room.on(Events.livestreamStopped, () {
  print('Live streaming has stopped');
});
onLivestreamStateChanged → const Events

Emitted when the room’s livestream state changes.

  • This event is triggered whenever the livestream lifecycle transitions between different states.

Possible livestream states

  • LIVESTREAM_STARTING: Livestream is initializing and has not started yet.

  • LIVESTREAM_STARTED: Livestream has started successfully.

  • LIVESTREAM_STOPPING: Livestream is in the process of stopping.

  • LIVESTREAM_STOPPED: Livestream has stopped successfully.

Event callback parameters

  • state (String): The current livestream state.

Example

room.on(Events.onLivestreamStateChanged, (String state) {
  print('Room livestream state: $state');
});
hlsStateChanged → const Events

Emitted when the room’s HLS (HTTP Live Streaming) state changes.

  • This event is triggered whenever the HLS lifecycle transitions between different states such as starting, playable, or stopped.

Possible HLS states

  • HLS_STARTING: HLS is initializing and has not started yet.

  • HLS_STARTED: HLS has started successfully.

  • HLS_PLAYABLE: HLS is live and playable; hlsUrl carries the URLs.

  • HLS_STOPPING: HLS is in the process of stopping.

  • HLS_STOPPED: HLS has stopped successfully.

Event callback parameters

  • state (String): the current HLS state.
  • hlsUrl (HLSUrl?): the stream's URLs, while it is playable.

Example

room.on(Events.hlsStateChanged, (String state, HLSUrl? hlsUrl) {
  print('Room HLS status: $state');
  if (state == 'HLS_PLAYABLE') {
    print('Playback URL: ${hlsUrl?.playbackHlsUrl}');
  }
});
transcriptionStateChanged → const Events

Emitted when the realtime transcription state changes.

  • This event is triggered whenever the lifecycle state of
  • realtime transcription is updated.

Possible transcription states

  • TRANSCRIPTION_STARTING: Realtime transcription is initializing and has not started yet.

  • TRANSCRIPTION_STARTED: Realtime transcription has started successfully.

  • TRANSCRIPTION_STOPPING: Realtime transcription is in the process of stopping.

  • TRANSCRIPTION_STOPPED: Realtime transcription has stopped successfully.

Event callback parameters

  • state (TranscriptionState): the current transcription state.

Example

room.on(Events.transcriptionStateChanged, (TranscriptionState state) {
  print('Room transcription status: ${state.name}');
});
transcriptionText → const Events

Emitted when realtime transcription text is received.

  • This event is triggered whenever new transcription text is generated during an active realtime transcription session.

  • The callback receives a TranscriptionText object containing details about the transcribed speech.

Event callback parameters

  • data (TranscriptionText):
    • participantId (String): ID of the participant whose speech was transcribed.
    • participantName (String): Display name of the participant.
    • text (String): Transcribed text.
    • timestamp (int): Time (in milliseconds since epoch) when the text was generated.
    • type (String): Type of transcription update.

Example

room.on(Events.transcriptionText, (TranscriptionText data) {
  print(
    'Transcription from ${data.participantName}: ${data.text}',
  );
});
error → const Events

Emitted when an error occurs in the room.

  • This event is triggered whenever the SDK encounters an error related to signaling, media handling, permissions, or internal processing during the room lifecycle.

Event callback parameters

  • error (VideoSDKError): its code, name and message.

Example

room.on(Events.error, (VideoSDKError error) {
  print('VIDEOSDK ERROR :: ${error.code} :: ${error.name} :: '
      '${error.message}');
});
whiteboardStarted → const Events

Emitted when whiteboard sharing starts.

Example

room.on(Events.whiteboardStarted, () {
  print('Whiteboard sharing has started');
});
whiteboardStopped → const Events

Emitted when whiteboard sharing stops.

Example

room.on(Events.whiteboardStopped, () {
  print('Whiteboard sharing has stopped');
});
onE2EEStateChanged → const Events

Emitted when the end-to-end encryption (E2EE) state of a participant's media changes. Delivered on the room with the map below, and on that Participant as (E2EEState state, RTCStream? stream).

Event callback parameters

  • data (Map<String, dynamic>):
    • participantId (String): whose media the state is about.
    • state (E2EEState): the new encryption state. Only the success states are reported today.
    • streamId (String): the stream it applies to.

Example

room.on(Events.onE2EEStateChanged, (Map<String, dynamic> data) {
  print('E2EE for ${data['participantId']}: ${data['state']}');
});
pausedAllStreams → const Events

Emitted when all or specific media streams are paused.

  • This event is triggered after media streams within the room are successfully paused, either globally or for a specific type.

Event callback parameters

  • kind (StreamKind?): The kind of stream that was paused, or null when every kind was.

Example

room.on(Events.pausedAllStreams, (StreamKind? kind) {
  print('Paused ${kind?.name ?? 'all'} streams');
});
resumedAllStreams → const Events

Emitted when all or specific media streams are resumed.

  • This event is triggered after paused media streams within the room are successfully resumed.

Event callback parameters

  • kind (StreamKind?): The kind of stream that was resumed, or null when every kind was.

Example

room.on(Events.resumedAllStreams, (StreamKind? kind) {
  print('Resumed ${kind?.name ?? 'all'} streams');
});
mediaRelayRequestReceived → const Events

Emitted when a media relay request is received in the destination room.

  • This event is triggered when a participant from another room requests to relay media streams into the current room.

Event callback parameters

  • participantId (String): The participant who requested the media relay.

  • roomId (String): The source room the request came from.

  • displayName (String): Display name of the participant who requested the relay.

  • accept (Function): Call this function to accept the media relay request.

  • reject (Function): Call this function to reject the media relay request.

Example

room.on(
  Events.mediaRelayRequestReceived,
  (
    String participantId,
    String roomId,
    String displayName,
    Function accept,
    Function reject,
  ) {
    print('Media relay request from $displayName');

    // Accept the relay request
    accept();

    // Or reject it
    // reject();
  },
);
mediaRelayStarted → const Events

Emitted when media relay to a destination room starts successfully.

Event callback parameters

  • roomId (String): The destination room where media relay has started.

Example

room.on(Events.mediaRelayStarted, (String roomId) {
  print('Media relay started for room: $roomId');
});
mediaRelayStopped → const Events

Emitted when media relay to a destination room stops.

  • This event may be triggered due to user action, connection issues, or other termination reasons.

Event callback parameters

  • roomId (String): The room where media relay was stopped.

  • reason (String): Reason for stopping the relay. Common values include:

    • user_stopped
    • connection_lost

Example

room.on(
  Events.mediaRelayStopped,
  (String roomId, String reason) {
    print(
      'Media relay stopped for room $roomId. '
      'Reason: $reason',
    );
  },
);
mediaRelayError → const Events

Emitted when an error occurs during media relay.

  • This event is triggered if the relay fails due to network issues, signaling errors, or internal failures.

Event callback parameters

  • roomId (String): The room where the error occurred.

  • reason (String): Description of the error.

Example

room.on(
  Events.mediaRelayError,
  (String roomId, String reason) {
    print(
      'Media relay error for room $roomId: $reason',
    );
  },
);
mediaRelayRequestResponse → const Events

Emitted when a response to a media relay request is received in the source room.

  • This event notifies the requester whether their relay request was accepted or rejected.

Event callback parameters

  • decidedBy (String): The participant ID who responded to the relay request.

  • decision (RelayDecision?): The decision for the request.

  • roomId (String?): The destination room the relay was requested for.

Example

room.on(
  Events.mediaRelayRequestResponse,
  (String decidedBy, RelayDecision? decision, String? roomId) {
    print(
      'Media relay response by $decidedBy '
      'for room $roomId: ${decision?.name}',
    );
  },
);
translationStateChanged → const Events

Emitted when realtime translation starts, stops, or moves between those states.

Event callback parameters

Example

room.on(Events.translationStateChanged, (TranslationState state) {
  print('Translation is ${state.name}');
});
translationText → const Events

Emitted for each translated line while realtime translation runs.

Event callback parameters

Example

room.on(Events.translationText, (TranslationText text) {
  print('${text.participantName} (${text.language}): ${text.text}');
});
translationLanguageChanged → const Events

Emitted when the translation language changes, after Room.changeTranslationLanguage.

Event callback parameters

  • participantId (String?): whose language changed.
  • language (String): the new language code.

Example

room.on(Events.translationLanguageChanged,
    (String? participantId, String language) {
  print('$participantId now reads $language');
});
agentStateChanged → const Events

Emitted when an AgentParticipant's operational state changes.

This event is fired any time the agent transitions between IDLE, LISTENING, THINKING, and SPEAKING states.

Event callback parameters

  • state (AgentState): The new operational state of the agent.

Example

agent.on(Events.agentStateChanged, (AgentState state) {
  print('Agent is now: ${state.name}');
});
agentTranscriptionReceived → const Events

Emitted when a transcription segment is received from an AgentParticipant.

Event callback parameters

Example

agent.on(
  Events.agentTranscriptionReceived,
  (TranscriptionSegment segment, Participant participant) {
    print('${participant.displayName}: ${segment.text}');
  },
);
agentMetrics → const Events

Emitted when metrics data is received from an AgentParticipant.

Event callback parameters

  • data (Map<String, dynamic>): The metrics payload received from the agent.

Example

agent.on(Events.agentMetrics, (Map<String, dynamic> data) {
  print('Agent metrics: $data');
});
dataReceived → const Events

Emitted when another participant sends a frame over the data channel — the receive side of Room.send.

Example

room.on(Events.dataReceived, (DataMessage message) {
  if (message.isBinary) {
    print('${message.data?.length} bytes from ${message.senderId}');
  } else {
    print('${message.senderId} says ${message.text}');
  }
});
externalCallRinging → const Events

Emitted when a phone call starts ringing on this device during the room. Delivers callType (CallType?).

Example

room.on(Events.externalCallRinging, (CallType? callType) {
  print('Ringing: ${callType?.name}');
});
externalCallAnswered → const Events

Emitted when the user answers a phone call during the room. Delivers callType (CallType?).

externalCallRejected → const Events

Emitted when a ringing phone call is declined or missed. Delivers callType (CallType?). Android cannot tell a declined call from a missed one, so it reports both.

externalCallHangup → const Events

Emitted when an answered phone call ends. Delivers callType (CallType?).

videoEffectsStats → const Events

Emitted about once a second with video-effects pipeline measurements, such as fpsEncoded and cpuMsP50. Other keys may be present.

Event callback parameters

  • stats (Map<String, dynamic>): the measurement row.

Example

room.on(Events.videoEffectsStats, (Map<String, dynamic> stats) {
  print('encoded ${stats['fpsEncoded']} fps, cpu ${stats['cpuMsP50']} ms');
});

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

values → const List<Events>
A constant List of the values in this enum, in order of their declaration.