Skip to main content
Version: 5.x.x

Room Class Events - Flutter

note

Listen to these events with room.on(). A handler can declare fewer parameters than an event delivers. If a parameter type does not match what the event delivers, the handler throws when the event fires, and the error reaches your app uncaught. The other handlers for that event still run.


roomJoined​

  • This event will be emitted when a localParticipant successfully joined the room.
  • localParticipant is set when this event fires, so read it here rather than right after join().
  • After switchTo(), this event fires again with a Map whose switchRoomId is the id of the room you switched to.

Example​

room.on(Events.roomJoined, (){
Participant localParticipant = room.localParticipant;
// do something
});

roomLeft​

  • This event will be emitted when a localParticipant left the room.
  • After this event is delivered, the room removes every handler and releases itself, unless the reason is LeaveReason.SWITCH_ROOM. To join again, create a new room.

Event handler parameters​

  • reason: LeaveReason

The table below outlines the possible reason codes and their descriptions:

ReasonCodeMessage
LeaveReason.WEBSOCKET_DISCONNECTED1001Socket disconnected
LeaveReason.REMOVE_PEER1002Participant was removed from the room
LeaveReason.REMOVE_PEER_VIEWER_MODE_CHANGED1003Participant Removed because viewer mode was changed
LeaveReason.REMOVE_PEER_MEDIA_RELAY_STOP1004Participant Removed because media relay was stopped
LeaveReason.SWITCH_ROOM1005Participant switched to a different room
LeaveReason.ROOM_CLOSE1006The room has been closed
LeaveReason.UNKNOWN1007Participant disconnected due to an unknown reason
LeaveReason.REMOVE_ALL1008Remove All from the room
LeaveReason.MEETING_END_API1009Room Ended.
LeaveReason.REMOVE_PEER_API1010Participant removed from the room
LeaveReason.DUPLICATE_PARTICIPANT1011Leaving room, since this participantId joined from another device
LeaveReason.MANUAL_LEAVE_CALLED1101Participant manually called the leave() method to exit the room
LeaveReason.WEBSOCKET_CONNECTION_ATTEMPTS_EXHAUSTED1102Room left after multiple failed websocket connection attempts.
LeaveReason.JOIN_ROOM_FAILED1103Room left due to an error while joining the room.
LeaveReason.SWITCH_ROOM_FAILED1104Room left due to an error while switching rooms.

Each LeaveReason has a code and a message.

Example​

room.on(Events.roomLeft, (LeaveReason? reason) {
// do something
});

participantJoined​

  • This event will be emitted when a new participant joined the room.

Event handler parameters​

Example​

room.on(Events.participantJoined, (Participant participant) {
// do something
});

participantLeft​

  • This event will be emitted when a joined participant left the room.

Event handler parameters​

  • participant: Participant - the participant who left
  • reason: LeaveReason

The possible reasons are the same as for roomLeft.

Example​

room.on(Events.participantLeft, (
Participant participant,
LeaveReason reason,
) {
print("${participant.displayName} left: ${reason.message}");
});

speakerChanged​

  • This event will be emitted when a active speaker changed.
  • If you want to know which participant is actively speaking, then this event will be used. getActiveSpeakerId() returns the latest value.

Event handler parameters​

  • activeSpeakerId: String?

Example​

room.on(Events.speakerChanged, (String? activeSpeakerId) {
// do something
});

presenterChanged​

  • This event will be emitted when any participant starts or stops screen sharing.
  • It will pass participantId as an event handler parameter.
  • If a participant stops screen-sharing, then this event will pass null as an event handler parameter.
  • getActivePresenterId() returns the latest value.

Event handler parameters​

  • activePresenterId: String?

Example​

room.on(Events.presenterChanged, (String? activePresenterId) {
// do something
});

streamEnabled​

  • This event will be emitted when an audio, video or screen-share stream of any participant, including the local participant, becomes available.
  • stream.participantId is the id of the participant the stream belongs to, and stream.kind is MediaType.AUDIO, MediaType.VIDEO, MediaType.SHARE or MediaType.SHARE_AUDIO (screen-share audio).
  • It is also delivered to handlers added with participant.on() on the participant the stream belongs to, and so are streamDisabled, streamPaused, streamResumed and onE2EEStateChanged.
  • To follow the state of one stream, listen for Events.streamStateChanged on that stream with stream.on().
  • Streams that already exist when your widget is built are in that participant's streams map.

Event handler parameters​

Example​

room.on(Events.streamEnabled, (RTCStream stream) {
String participantId = stream.participantId;
if (stream.kind == MediaType.VIDEO) {
// render stream.renderer with RTCVideoView
}
});

streamDisabled​

  • This event will be emitted when an audio, video or screen-share stream of any participant, including the local participant, stops.
  • stream.participantId is the id of the participant the stream belongs to.

Event handler parameters​

Example​

room.on(Events.streamDisabled, (RTCStream stream) {
String participantId = stream.participantId;
// remove the stream from your UI
});

streamPaused​

  • This event will be emitted when a stream you receive is paused.
  • The room's handler does not say which participant's stream was paused. To know that, listen with participant.on().

Event handler parameters​

  • kind: String? - audio, video or share
  • reason: String? - why the stream was paused, as the server reports it

Example​

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

streamResumed​

  • This event will be emitted when a paused stream you receive is resumed.
  • The room's handler does not say which participant's stream was resumed. To know that, listen with participant.on().

Event handler parameters​

  • kind: String? - audio, video or share
  • reason: String? - why the stream was resumed, as the server reports it

Example​

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

onE2EEStateChanged​

  • This event will be emitted when the end-to-end encryption state of a participant's media changes. It reports EncryptionSuccess when your media starts being encrypted, and DecryptionSuccess when a participant's media starts being decrypted.
  • The participant also delivers it, with the E2EEState and the RTCStream. See participant events.
  • To check whether end-to-end encryption is set up, read e2eeEnabled. To learn more, see the E2EE guide.

Event handler parameters​

  • data: Map<String, dynamic>
    • participantId: String - whose media the state is about
    • state: E2EEState - the new encryption state: EncryptionSuccess or DecryptionSuccess. The enum also has EncryptionFailed, DecryptionFailed and InternalError; decryption failures are not reported yet.
    • streamId: String - the stream the state applies to

Example​

room.on(Events.onE2EEStateChanged, (Map<String, dynamic> data) {
if (data['state'] == E2EEState.DecryptionSuccess) {
print("Decrypting stream ${data['streamId']} of ${data['participantId']}");
}
});

pinStateChanged​

  • This event will be emitted when any participant pin state gets changed.
  • It will pass participantId, state, and pinnedBy as Map<String, dynamic> as an event handler parameter.

Event handler parameters​

  • data: Map<String, dynamic>
    • participantId: String - whose pin state changed
    • state: ParticipantPinState - cam and share say what is pinned now
    • pinnedBy: String? - who pinned or unpinned

Example​

room.on(Events.pinStateChanged, (Map<String, dynamic> data) {
final ParticipantPinState state = data['state'];
print("${data['participantId']}: cam pinned ${state.cam}, share pinned ${state.share}");
});

participantModeChanged​

This event is triggered when a participant's mode is updated.

It passes data as an event callback parameter, which includes the following:

  • SEND_AND_RECV: The participant sends and receives audio and video.

  • SIGNALLING_ONLY: The participant neither sends nor receives audio or video.

  • RECV_ONLY: The participant receives audio and video but sends none.

Use this event to keep track of each participant's current mode.

Event handler parameters​

  • data: Map<String, dynamic>
    • participantId: String - whose mode changed
    • mode: Mode - the new mode
info

Important Changes Flutter SDK in Version v1.3.0

  • The following modes have been deprecated:
    • CONFERENCE has been replaced by SEND_AND_RECV
    • VIEWER has been replaced by SIGNALLING_ONLY

Please update your implementation to use the new modes.

⚠️ Compatibility Notice:
To ensure a seamless meeting experience, all participants must use the same SDK version.
Do not mix version v1.3.0 + with older versions, as it may cause significant conflicts.

Example​

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

entryRequested​

  • This event will be emitted when a new participant, who is trying to join the room, is having permission ask_join in token.
  • Answer with the allow() and deny() functions it passes, or with room.respondEntry().
  • This event will only be emitted to the participants in the room, who is having the permission allow_join in token.
  • This event will pass following parameters as an event parameters, participantId and name of the new participant who is trying to join the room, allow() and deny() to take required actions.

Event handler parameters​

  • data: Map<String, dynamic>{ "allow": Function; "deny": Function; "name": String; "participantId": String }
    • allow: Function
    • deny: Function
    • name: String
    • participantId: String

allow and deny return a Future. Await it.

Example​

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

Function allow = data["allow"];
Function deny = data["deny"];

print("$name requested to join the room.");

try {
// Allow the entry request, or call deny() to refuse it
await allow();
} on VideoSDKError catch (error) {
print("Could not answer the request: ${error.code} ${error.name}");
}
});

entryResponded​

  • This event will be emitted when the join() request is responded.
  • This event will be emitted to the participants in the room, who is having the permission allow_join in token.
  • This event will be also emitted to the participant, who requested to join the room.

Event handler parameters​

  • data: Map<String, dynamic>
    • participantId: String - the id of the participant who requested to join the room
    • decision: "allowed" | "denied"

Example​

room.on(Events.entryResponded, (Map<String, dynamic> data) {
// data['participantId'] will be id of participant, who requested to join room
String participantId = data['participantId'];

if (data['decision'] == "allowed") {
// entry allowed
} else {
// entry denied
}
});

cameraRequested​

  • This event will be emitted to the participant B when any other participant A requests to enable camera of participant B.
  • On accepting the request, camera of participant B will be enabled.

Event handler parameters​

  • data: Map<String, dynamic>
    • participantId: String - who sent the request
    • accept: Function
    • reject: Function

accept and reject return a Future. Await it.

Example​

room.on(Events.cameraRequested, (Map<String, dynamic> data) async {

String requestedBy = data["participantId"];
Function accept = data["accept"];
Function reject = data["reject"];

try {
// Accept the request, or call reject() to refuse it
await accept();
} on VideoSDKError catch (error) {
print("Could not answer the request: ${error.code} ${error.name}");
}
});

micRequested​

  • This event will be emitted to the participant B when any other participant A requests to enable mic of participant B.
  • On accepting the request, mic of participant B will be enabled.

Event handler parameters​

  • data: Map<String, dynamic>
    • participantId: String - who sent the request
    • accept: Function
    • reject: Function

accept and reject return a Future. Await it.

Example​

room.on(Events.micRequested, (Map<String, dynamic> data) async {

String requestedBy = data["participantId"];
Function accept = data["accept"];
Function reject = data["reject"];

try {
// Accept the request, or call reject() to refuse it
await accept();
} on VideoSDKError catch (error) {
print("Could not answer the request: ${error.code} ${error.name}");
}
});

recordingStarted​

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

  • This event will be emitted when recording of the room is started.

Example​

room.on(Events.recordingStarted, () {
// do something
});

recordingStopped​

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

  • This event will be emitted when recording of the room is stopped.

Example​

room.on(Events.recordingStopped, () {
// do something
});

recordingStateChanged​

  • This event will be emitted when the room's recording status changed.

Event callback parameters​

  • status: String

status has following values

  • RECORDING_STARTING - Recording is in starting phase and hasn't started yet.
  • RECORDING_STARTED - Recording has started successfully.
  • RECORDING_STOPPING - Recording is in stopping phase and hasn't stopped yet.
  • RECORDING_STOPPED - Recording has stopped successfully.

Example​

room.on(Events.recordingStateChanged, (String status) {
print("Room recording status : $status");
});

livestreamStarted​

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

  • This event will be emitted when RTMP live stream of the room is started.

Example​

room.on(Events.livestreamStarted, () {
// do something
});

livestreamStopped​

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

  • This event will be emitted when RTMP live stream of the room is stopped.

Example​

room.on(Events.livestreamStopped, () {
// do something
});

onLivestreamStateChanged​

  • This event will be emitted when the room's livestream status changed. liveStreamState holds the latest value.

Event callback parameters​

  • state: String

state has following values

  • LIVESTREAM_STARTING - Livestream is in starting phase and hasn't started yet.
  • LIVESTREAM_STARTED - Livestream has started successfully.
  • LIVESTREAM_STOPPING - Livestream is in stopping phase and hasn't stopped yet.
  • LIVESTREAM_STOPPED - Livestream has stopped successfully.

Example​

room.on(Events.onLivestreamStateChanged, (String state) {
print("Room livestream state: $state");
});

hlsStateChanged​

  • This event will be emitted when the room's HLS(Http Livestreaming) status changed.

Event callback parameters​

  • state: String
  • hlsUrl: HLSUrl? set only while HLS is playable
    • playbackHlsUrl: String? - Live HLS with playback support
    • livestreamUrl: String? - Live HLS without playback support

state has following values

  • HLS_STARTING - Hls is in starting phase and hasn't started yet.
  • HLS_STARTED - Hls has started successfully.
  • HLS_PLAYABLE - Hls has started can be played now, and hlsUrl carries its URLs.
  • HLS_STOPPING - Hls is in stopping phase and hasn't stopped yet.
  • HLS_STOPPED - Hls has stopped successfully.

hlsState and hlsUrl hold the latest values.

Example​

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

transcriptionStateChanged​

  • This event will be triggered whenever state of realtime transcription is changed.

Event callback parameters​

  • state: TranscriptionState

state has following values

  • TranscriptionState.TRANSCRIPTION_STARTING - Realtime Transcription is in starting phase and hasn't started yet.
  • TranscriptionState.TRANSCRIPTION_STARTED - Realtime Transcription has started successfully.
  • TranscriptionState.TRANSCRIPTION_STOPPING - Realtime Transcription is in stopping phase and hasn't stopped yet.
  • TranscriptionState.TRANSCRIPTION_STOPPED - Realtime Transcription has stopped successfully.

Example​

room.on(Events.transcriptionStateChanged, (TranscriptionState state) {
print("Room transcription state : ${state.name}");
});

transcriptionText​

  • This event will be emitted when text for running realtime transcription received.

Event handler parameters​

  • data: TranscriptionText
    • participantId: String? - who spoke
    • participantName: String? - the speaker's name
    • text: String? - the transcribed text
    • timestamp: int? - when it was said, in milliseconds
    • type: TranscriptionType? - REALTIME for a partial result that can still change, FULL_SENTENCE for the settled sentence, or null

Example​

room.on(Events.transcriptionText, (TranscriptionText data) {
// Show REALTIME text as a live caption; keep only FULL_SENTENCE text in the transcript.
if (data.type == TranscriptionType.FULL_SENTENCE) {
print("${data.participantName} said: ${data.text} (${data.timestamp})");
}
});

translationStateChanged​

  • This event will be emitted when the state of realtime translation changes.

Event callback parameters​

  • state: TranslationState

state has following values

  • TranslationState.TRANSLATION_STARTING - Realtime Translation is in starting phase and hasn't started yet.
  • TranslationState.TRANSLATION_STARTED - Realtime Translation has started successfully.
  • TranslationState.TRANSLATION_STOPPING - Realtime Translation is in stopping phase and hasn't stopped yet.
  • TranslationState.TRANSLATION_STOPPED - Realtime Translation has stopped successfully.

Example​

room.on(Events.translationStateChanged, (TranslationState state) {
print("Room translation status : ${state.name}");
});

translationText​

  • This event will be emitted for each translated line while realtime translation runs.

Event callback parameters​

  • data: TranslationText
    • participantId: String? - the participant who spoke
    • participantName: String? - the display name of that participant
    • participantLanguage: String? - the language that participant spoke in
    • language: String? - the language of text
    • text: String? - the translated text
    • timestamp: double? - when the line was spoken, in milliseconds since the epoch
    • type: TranslationType? - TranslationType.PARTIAL for a line that a later line for the same utterance replaces, TranslationType.FULL for the settled line to add to a transcript, or null for a value the SDK does not know

Example​

room.on(Events.translationText, (TranslationText data) {
print("${data.participantName} (${data.language}): ${data.text}");
});

translationLanguageChanged​

  • This event will be emitted when any participant, including the local participant, changes their translation language, for example with changeTranslationLanguage().

Event callback parameters​

  • participantId: String? - the participant whose language changed
  • language: String - the new language code

Example​

room.on(Events.translationLanguageChanged, (String? participantId, String language) {
print("$participantId now reads $language");
});

error​

  • This event will be emitted when an error occurs in the room.
  • code is an int. Some failures of your own calls arrive here too, for example a failed send() (3070), so the same failure can reach both your catch block and this handler. See Room Error Codes for the codes.

Event handler parameters​

  • error: VideoSDKError
    • code: int
    • name: String
    • message: String

Example​

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

whiteboardStarted​

  • This event will be emitted when a whiteboard session is successfully started.
  • It returns a URL that can be used to render the whiteboard in the app or in a web view.

Example​

room.on(Events.whiteboardStarted, (String url) {
// do something
});

whiteboardStopped​

  • This event will be emitted when a whiteboard session successfully ends.

Example​

room.on(Events.whiteboardStopped, () {
// do something
});

dataReceived​

  • This event will be emitted when another participant sends a message with send().

Event callback parameters​

  • message: DataMessage
    • senderId: String? - the id of the participant who sent it
    • isBinary: bool - true for binary data, false for text
    • text: String? - the text of a text message, or null for a binary message
    • data: Uint8List? - the data of a binary message, or null for a text message
    • reliable: bool - whether the sender used reliable, ordered delivery
    • timestamp: int? - when it was sent, in milliseconds

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}");
}
});

roomStateChanged​

  • This event is triggered whenever the room's state changes.
  • The current state of the room is passed as a callback parameter.
  • All available states are RoomState.CONNECTING, RoomState.CONNECTED, RoomState.DISCONNECTED, RoomState.RECONNECTING and RoomState.FAILED. FAILED means the connection failed and will not be retried.
  • roomState holds the latest value.

Event callback parameters​

  • state: RoomState

Example​

room.on(Events.roomStateChanged, (RoomState state) {
switch (state) {
case RoomState.CONNECTING:
print('Room is Connecting');
break;
case RoomState.CONNECTED:
print('Room is Connected');
break;
case RoomState.DISCONNECTED:
print('Room connection disconnected abruptly');
break;
case RoomState.RECONNECTING:
print('Room in reconnection state');
break;
case RoomState.FAILED:
print('Room connection failed');
break;
}
});

pausedAllStreams​

  • This event is triggered when all or specified media streams within the room are successfully paused.

Parameters​

  • kind: The kind of stream that was paused, or null when every kind was.
    • Type: StreamKind?
    • Possible values: StreamKind.AUDIO, StreamKind.VIDEO or StreamKind.SHARE (screen-share video).

Example​

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

resumedAllStreams​

  • This event is triggered when all or specified media streams within the room are successfully resumed.

Parameters​

  • kind: The kind of stream that was resumed, or null when every kind was.
    • Type: StreamKind?
    • Possible values: StreamKind.AUDIO, StreamKind.VIDEO or StreamKind.SHARE (screen-share video).

Example​

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

mediaRelayRequestReceived()​

  • This callback is triggered in the destination room when a participant of another room asks to relay their media into it.
  • Call accept() or reject() to answer.

Parameters​

  • participantId - (String): The participant who asked for the relay.

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

  • displayName - (String): The name of the participant who asked.

  • accept - (Function): Call it to accept the request.

  • reject - (Function): Call it to reject the request.

Example​

room.on(Events.mediaRelayRequestReceived, (
String participantId,
String roomId,
String displayName,
Function accept,
Function reject,
) {
print("$displayName from room $roomId wants to relay media");
accept();
});

mediaRelayRequestResponse()​

  • This callback is triggered when a response is received for a media relay request in the source room.

Parameters​

  • decidedBy - (String): Specifies the participantId who responded the request for the media relay.

  • decision - (RelayDecision?): RelayDecision.ACCEPTED or RelayDecision.REJECTED.

  • roomId - (String?): Specifies the destination room for which the media relay was requested. It can be null.

Example​

room.on(Events.mediaRelayRequestResponse, (String decidedBy, RelayDecision? decision, String? roomId) {
print("Media Relay response by: $decidedBy, decision: ${decision?.name}, roomId: $roomId");
});

mediaRelayStarted()​

  • This callback is triggered when the media relay to the destination room successfully starts.

Parameters​

  • roomId - (String): Specifies the room where the media relay started.

Example​

room.on(Events.mediaRelayStarted, (String roomId) {
print("Media relay started: $roomId");
});

mediaRelayStopped()​

  • This callback is triggered when the media relay to the destination room stops for any reason.

Parameters​

  • roomId - (String): Specifies the room where the media relay stopped.

  • reason - (String?): Specifies the reason why the media relay stopped, as the server reports it. It can be null.

Example​

room.on(Events.mediaRelayStopped, (String roomId, String? reason) {
print("Media relay to $roomId stopped: $reason");
});

mediaRelayError()​

  • This callback is triggered when an error occurs during media relay to the destination room.

Parameters​

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

  • reason - (String): Describes the error.

Example​

room.on(Events.mediaRelayError, (String roomId, String reason) {
print("Media Relay error: ${reason}");
});

qualityLimitation​

  • This event is triggered when a limitation on the quality of the video you send is detected or resolved during the room.
  • The values are in upper case.

Parameters​

  • type: Specifies the type of limitation.

    • Type: String
    • Possible values:
      • "CONGESTION": Network congestion detected.
      • "BANDWIDTH": Insufficient network bandwidth.
      • "CPU": High CPU usage on the device.
  • state: Specifies whether the limitation is currently active or resolved.

    • Type: String
    • Possible values:
      • "DETECTED": Limitation has been detected.
      • "RESOLVED": Limitation has been resolved.
  • timestamp: When the limitation changed, in milliseconds since the epoch.

    • Type: int?

Example​

room.on(Events.qualityLimitation, (String type, String state, int? timestamp) {
if (state == "DETECTED") {
print("Video quality is limited by $type");
}
});

codecChanged​

  • This event is triggered when the SDK switches the codec of the video your camera sends, because the server or a remote participant cannot decode it. It fires only while codecSwitchEnabled in VideoSDK.createRoom() is true, which is the default.

Event callback parameters​

  • data: CodecChangeInfo
    • unsupportedRemoteCodec: VideoCodec - the codec that could not be decoded
    • currentCodec: VideoCodec - the codec your camera sends now
    • previousCodec: VideoCodec - the codec your camera sent before the switch
    • kind: String - the media kind, always video
    • causedBy: Participant? - the remote participant who could not decode it, if known

Example​

room.on(Events.codecChanged, (CodecChangeInfo data) {
print("Codec changed from ${data.previousCodec.name} to ${data.currentCodec.name}");
});

videoEffectsStats​

  • This event is triggered once a second with measurements of your camera video, such as fpsEncoded and cpuMsP50, while your camera is sending video. Screen share is not measured. Other keys may be present.
  • It is a diagnostic event and is off by default. To turn it on for a test device, run adb shell settings put global videosdk_effects_stats 1 on Android, or set the environment variable VIDEOSDK_EFFECTS_STATS to 1 in your Xcode scheme on iOS. Then restart the app.
  • Use it to measure the cost of the effects you apply with setVideoEffects().

Event callback parameters​

  • stats: Map<String, dynamic>

Example​

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

externalCallRinging​

  • This event is triggered when a phone call starts ringing on this device during the room.

Event callback parameters​

  • callType: CallType? - CallType.INCOMING or CallType.OUTGOING

Example​

room.on(Events.externalCallRinging, (CallType? callType) {
print("Ringing: ${callType?.name}");
});

externalCallAnswered​

  • This event is triggered when the user answers a phone call during the room.

Event callback parameters​

  • callType: CallType? - CallType.INCOMING or CallType.OUTGOING

Example​

room.on(Events.externalCallAnswered, (CallType? callType) {
print("Answered a ${callType?.name} call");
});

externalCallRejected​

  • This event is triggered when a ringing phone call is declined or missed.
  • On Android, a declined call and a missed call both trigger it.

Event callback parameters​

  • callType: CallType? - CallType.INCOMING or CallType.OUTGOING

Example​

room.on(Events.externalCallRejected, (CallType? callType) {
print("Declined a ${callType?.name} call");
});

externalCallHangup​

  • This event is triggered when an answered phone call ends.

Event callback parameters​

  • callType: CallType? - CallType.INCOMING or CallType.OUTGOING

Example​

room.on(Events.externalCallHangup, (CallType? callType) {
print("A ${callType?.name} call ended");
});

Got a Question? Ask us on discord