TUICallObserver is the callback class of TUICallEngine. You can use it to listen for events.API | Description |
A call occurred during the call. | |
Callback when a user is invited to join a call. | |
A call invitation was received. | |
Callback for call cancellation | |
The call was connected. | |
The call ended. | |
The call type changed. | |
A user declined the call. | |
A user didn't respond. | |
A user was busy. | |
A user joined the call. | |
A user left the call. | |
Whether a user had a video stream. | |
Whether a user had an audio stream. | |
The volume levels of all users. | |
The network quality of all users. | |
The current user was kicked offline. | |
The user sig is expired. |
TUICallEngine.instance.addObserver(TUICallObserver(onError: (int code, String message) {},onCallCancelled: (String callerId) {}, onCallBegin: (TUIRoomId roomId, TUICallMediaType callMediaType, TUICallRole callRole) {}, onCallEnd: (TUIRoomId roomId, TUICallMediaType callMediaType, TUICallRole callRole, double totalTime) {}, onCallMediaTypeChanged: (TUICallMediaType oldCallMediaType, TUICallMediaType newCallMediaType) {}, onUserReject: (String userId) {}, onUserNoResponse: (String userId) {}, onUserLineBusy: (String onUserLineBusy) {}, onUserJoin: (String userId) {}, onUserLeave: (String userId) {}, onUserVideoAvailable: (String userId, bool isVideoAvailable) {}, onUserAudioAvailable: (String userId, bool isAudioAvailable) {}, onUserNetworkQualityChanged: (List<TUINetworkQualityInfo> networkQualityList) {}, onCallReceived: (String callerId, List<String> calleeIdList, String groupId, TUICallMediaType callMediaType) {}, onUserVoiceVolumeChanged: (Map<String, int> volumeMap) {}, onKickedOffline: () {}, onUserSigExpired: () {}));
TUICallEngine.instance.addObserver(TUICallObserver(onError: (int code, String message) {}));
Parameter | Type | Description |
code | int | The error code. |
message | String | The error message. |
TUICallEngine.instance.addObserver(TUICallObserver(onUserInviting: (String userId) {// TODO}));
Parameter | Type | Meaning |
userId | String | ID of the invited user |
TUICallEngine.instance.addObserver(TUICallObserver(onCallReceived: (String callId, String callerId, List<String> calleeIdList, TUICallMediaType mediaType, CallObserverExtraInfo info) {// TODO}));
Parameter | Type | Meaning |
callId | String | Unique ID of this call |
callerId | String | Calling ID (inviter) |
calleeIdList | List<String> | Called ID list (invitees) |
mediaType | Media type of the call. For example: TUICallMediaType.video or TUICallMediaType.audio | |
info | Extended information |
TUICallEngine.instance.addObserver(TUICallObserver(onCallNotConnected: (String callId, TUICallMediaType mediaType, CallEndReason reason,String userId, CallObserverExtraInfo info) {// TODO}));
Parameter | Type | Meaning |
callId | String | Unique ID of this call |
mediaType | Media type of the call. For example: TUICallMediaType.video or TUICallMediaType.audio | |
reason | The causes for call termination | |
userId | String | User ID ending the call |
info | Extended information |
TUICallEngine.instance.addObserver(TUICallObserver(onCallBegin: (String callId, TUICallMediaType mediaType, CallObserverExtraInfo info) {// TODO}));
Parameter | Type | Meaning |
callId | String | Unique ID of this call |
mediaType | Media type of the call. For example: TUICallMediaType.video or TUICallMediaType.audio | |
info | Extended information |
TUICallEngine.instance.addObserver(TUICallObserver(onCallEnd: (String callId, TUICallMediaType mediaType, CallEndReason reason,String userId, double totalTime, CallObserverExtraInfo info) {// TODO}));
Parameter | Type | Meaning |
callId | String | Unique ID of this call |
mediaType | Media type of the call. For example: TUICallMediaType.video or TUICallMediaType.audio | |
reason | The causes for call termination | |
userId | String | User ID ending the call |
totalTime | double | Duration of this call, unit ms |
info | Extended information |
TUICallEngine.instance.addObserver(TUICallObserver(onCallMediaTypeChanged: (TUICallMediaType oldCallMediaType, TUICallMediaType newCallMediaType) {}));
Parameter | Type | Description |
oldCallMediaType | The call type before the change. | |
newCallMediaType | The call type after the change. |
TUICallEngine.instance.addObserver(TUICallObserver(onUserReject: (String userId) {}));
Parameter | Type | Description |
res.userId | String | The user ID of the invitee who rejected the call. |
TUICallEngine.instance.addObserver(TUICallObserver(onUserNoResponse: (String userId) {}));
Parameter | Type | Description |
userId | String | The user ID of the invitee who did not answer. |
TUICallEngine.instance.addObserver(TUICallObserver(onUserLineBusy: (String onUserLineBusy) {},));
Parameter | Type | Description |
userId | String | The user ID of the invitee who is busy. |
TUICallEngine.instance.addObserver(TUICallObserver(onUserJoin: (String userId) {}));
Parameter | Type | Description |
userId | String | The ID of the user who joined the call. |
TUICallEngine.instance.addObserver(TUICallObserver(onUserLeave: (String userId) {}));
Parameter | Type | Description |
userId | String | The ID of the user who left the call. |
TUICallEngine.instance.addObserver(TUICallObserver(onUserVideoAvailable: (String userId, bool isVideoAvailable) {}));
Parameter | Type | Description |
userId | String | The user ID. |
isVideoAvailable | bool | Whether the user has video. |
TUICallEngine.instance.addObserver(TUICallObserver(onUserAudioAvailable: (String userId, bool isAudioAvailable) {}));
Parameter | Type | Description |
userId | String | The user ID. |
isAudioAvailable | bool | Whether the user has audio. |
TUICallEngine.instance.addObserver(TUICallObserver(onUserVoiceVolumeChanged: (Map<String, int> volumeMap) {}));
Parameter | Type | Description |
volumeMap | Map<String, int> | The volume table, which includes the volume of each user (userId). Value range: 0-100. |
TUICallEngine.instance.addObserver(TUICallObserver(onUserNetworkQualityChanged: (List<TUINetworkQualityInfo> networkQualityList) {}));class TUINetworkQualityInfo {String userId;TUINetworkQuality quality;TUINetworkQualityInfo({required this.userId, required this.quality});}enum TUINetworkQuality {unknown,excellent,good,poor,bad,vBad,down}
Parameter | Type | Description |
networkQualityList | The current network conditions for all users (userId). |
initagain.TUICallEngine.instance.addObserver(TUICallObserver(onKickedOffline: () {}));
userSig, and then invoke initagain.TUICallEngine.instance.addObserver(TUICallObserver(onUserSigExpired: () {}));
TUICallEngine.instance.addObserver(TUICallObserver(onCallCancelled: (String userId) {}));
Parameter | Type | Description |
userId | String | The user ID of the inviter. |
Feedback