Room Class Events - Flutter
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.
localParticipantis set when this event fires, so read it here rather than right afterjoin().- After
switchTo(), this event fires again with aMapwhoseswitchRoomIdis 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:
| Reason | Code | Message |
|---|---|---|
LeaveReason.WEBSOCKET_DISCONNECTED | 1001 | Socket disconnected |
LeaveReason.REMOVE_PEER | 1002 | Participant was removed from the room |
LeaveReason.REMOVE_PEER_VIEWER_MODE_CHANGED | 1003 | Participant Removed because viewer mode was changed |
LeaveReason.REMOVE_PEER_MEDIA_RELAY_STOP | 1004 | Participant Removed because media relay was stopped |
LeaveReason.SWITCH_ROOM | 1005 | Participant switched to a different room |
LeaveReason.ROOM_CLOSE | 1006 | The room has been closed |
LeaveReason.UNKNOWN | 1007 | Participant disconnected due to an unknown reason |
LeaveReason.REMOVE_ALL | 1008 | Remove All from the room |
LeaveReason.MEETING_END_API | 1009 | Room Ended. |
LeaveReason.REMOVE_PEER_API | 1010 | Participant removed from the room |
LeaveReason.DUPLICATE_PARTICIPANT | 1011 | Leaving room, since this participantId joined from another device |
LeaveReason.MANUAL_LEAVE_CALLED | 1101 | Participant manually called the leave() method to exit the room |
LeaveReason.WEBSOCKET_CONNECTION_ATTEMPTS_EXHAUSTED | 1102 | Room left after multiple failed websocket connection attempts. |
LeaveReason.JOIN_ROOM_FAILED | 1103 | Room left due to an error while joining the room. |
LeaveReason.SWITCH_ROOM_FAILED | 1104 | Room 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
- participant: Participant
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
participantIdas an event handler parameter. - If a participant stops screen-sharing, then this event will pass
nullas 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.participantIdis the id of the participant the stream belongs to, andstream.kindisMediaType.AUDIO,MediaType.VIDEO,MediaType.SHAREorMediaType.SHARE_AUDIO(screen-share audio).- It is also delivered to handlers added with
participant.on()on the participant the stream belongs to, and so arestreamDisabled,streamPaused,streamResumedandonE2EEStateChanged. - To follow the state of one stream, listen for
Events.streamStateChangedon that stream withstream.on(). - Streams that already exist when your widget is built are in that participant's
streamsmap.
Event handler parameters
- stream: RTCStream
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.participantIdis the id of the participant the stream belongs to.
Event handler parameters
- stream: RTCStream
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,videoorshare - 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,videoorshare - 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
EncryptionSuccesswhen your media starts being encrypted, andDecryptionSuccesswhen a participant's media starts being decrypted. - The participant also delivers it, with the
E2EEStateand theRTCStream. 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:EncryptionSuccessorDecryptionSuccess. The enum also hasEncryptionFailed,DecryptionFailedandInternalError; 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, andpinnedByasMap<String, dynamic>as an event handler parameter.
Event handler parameters
- data:
Map<String, dynamic>- participantId:
String- whose pin state changed - state:
ParticipantPinState-camandsharesay what is pinned now - pinnedBy:
String?- who pinned or unpinned
- participantId:
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
- participantId:
Important Changes Flutter SDK in Version v1.3.0
- The following modes have been deprecated:
CONFERENCEhas been replaced bySEND_AND_RECVVIEWERhas been replaced bySIGNALLING_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_joinin token. - Answer with the
allow()anddeny()functions it passes, or withroom.respondEntry(). - This event will only be emitted to the participants in the room, who is having the permission
allow_joinin token. - This event will pass following parameters as an event parameters,
participantIdandnameof the new participant who is trying to join the room,allow()anddeny()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_joinin 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
Bwhen any other participantArequests to enable camera of participantB. - On accepting the request, camera of participant
Bwill be enabled.
Event handler parameters
- data:
Map<String, dynamic>- participantId:
String- who sent the request - accept: Function
- reject: Function
- participantId:
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
Bwhen any other participantArequests to enable mic of participantB. - On accepting the request, mic of participant
Bwill be enabled.
Event handler parameters
- data:
Map<String, dynamic>- participantId:
String- who sent the request - accept: Function
- reject: Function
- participantId:
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
RTMPlive 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
RTMPlive 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.
liveStreamStateholds 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, andhlsUrlcarries 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?-REALTIMEfor a partial result that can still change,FULL_SENTENCEfor the settled sentence, ornull
- participantId:
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.PARTIALfor a line that a later line for the same utterance replaces,TranslationType.FULLfor the settled line to add to a transcript, ornullfor 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.
codeis anint. Some failures of your own calls arrive here too, for example a failedsend()(3070), so the same failure can reach both yourcatchblock 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
URLthat 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 -
truefor binary data,falsefor text - text: String? - the text of a text message, or
nullfor a binary message - data: Uint8List? - the data of a binary message, or
nullfor 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.RECONNECTINGandRoomState.FAILED.FAILEDmeans the connection failed and will not be retried. roomStateholds 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, ornullwhen every kind was.- Type:
StreamKind? - Possible values:
StreamKind.AUDIO,StreamKind.VIDEOorStreamKind.SHARE(screen-share video).
- Type:
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, ornullwhen every kind was.- Type:
StreamKind? - Possible values:
StreamKind.AUDIO,StreamKind.VIDEOorStreamKind.SHARE(screen-share video).
- Type:
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()orreject()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.ACCEPTEDorRelayDecision.REJECTED. -
roomId - (String?): Specifies the destination room for which the media relay was requested. It can benull.
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 benull.
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.
- Type:
-
state: Specifies whether the limitation is currently active or resolved.- Type:
String - Possible values:
"DETECTED": Limitation has been detected."RESOLVED": Limitation has been resolved.
- Type:
-
timestamp: When the limitation changed, in milliseconds since the epoch.- Type:
int?
- Type:
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
codecSwitchEnabledinVideoSDK.createRoom()istrue, 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
- unsupportedRemoteCodec:
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
fpsEncodedandcpuMsP50, 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 1on Android, or set the environment variableVIDEOSDK_EFFECTS_STATSto1in 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.INCOMINGorCallType.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.INCOMINGorCallType.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.INCOMINGorCallType.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.INCOMINGorCallType.OUTGOING
Example
room.on(Events.externalCallHangup, (CallType? callType) {
print("A ${callType?.name} call ended");
});
Got a Question? Ask us on discord

