tencent cloud

Tencent Real-Time Communication

お知らせ・リリースノート
製品アップデート情報
Tencent Cloudオーディオビデオ端末SDKの再生アップグレードおよび承認チェック追加に関するお知らせ
TRTCアプリケーションのサブスクリプションパッケージサービスのリリースに関する説明について
製品の説明
製品概要
基礎概念
製品の機能
製品の強み
ユースケース
性能データ
購入ガイド
Billing Overview
無料時間の説明
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
課金に関するよくあるご質問
Refund Instructions
初心者ガイド
Demo体験
Call
コンポーネントの説明(TUICallKit)
Activate the Service
Run Demo
クイック導入
オフライン通知
Conversational Chat
クラウドレコーディング(TUICallKit)
AI Noise Reduction
インターフェースのカスタマイズ
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
公開ログ
よくある質問
ライブ配信
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
Demo のクイックスタート
No UI Integration
UI Customization
Live Broadcast Monitoring
Video Live Streaming
Voice Chat Room
Advanced Features
Client APIs
Server APIs
Error Codes
Release Notes
FAQs
RTC Engine
Activate Service
SDKのダウンロード
APIコードサンプル
Usage Guidelines
クライアント側 API
高度な機能
RTC RESTFUL API
History
Introduction
API Category
Room Management APIs
Stream mixing and relay APIs
On-cloud recording APIs
Data Monitoring APIs
Pull stream Relay Related interface
Web Record APIs
AI Service APIs
Cloud Slicing APIs
Cloud Moderation APIs
Making API Requests
Call Quality Monitoring APIs
Usage Statistics APIs
Data Types
Appendix
Error Codes
コンソールガイド
アプリケーション管理
使用統計
監視ダッシュボード
開発支援
Solution
Real-Time Chorus
よくあるご質問
課金関連問題
機能関連
UserSig関連
ファイアウォールの制限の対応関連
インストールパッケージの圧縮に関するご質問
AndriodおよびiOS関連
Web端末関連
Flutter関連
Electron関連
TRTCCalling Web関連
オーディオビデオ品質関連
その他のご質問
旧バージョンのドキュメント
TUIRoom(Web)の統合
TUIRoom (Android)の統合
TUIRoom (iOS)の統合
TUIRoom (Flutter)の統合
TUIRoom (Electron)の統合
TUIRoom APIのクエリー
クラウドレコーディングと再生の実現(旧)
Protocols and Policies
セキュリティコンプライアンス認証
セキュリティホワイトペーパー
情報セキュリティの説明
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC ポリシー
プライバシーポリシー
データ処理とセキュリティ契約
用語集

TUICallObserver

PDF
フォーカスモード
フォントサイズ
最終更新日: 2025-04-10 11:39:18

TUICallObserver API

TUICallObserver is the callback class of TUICallEngine. You can use it to listen for events.

Overview

API
Description
onError
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.
onCallEnd
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.

Details

Listen to the events thrown by the Flutter plugin through addObserver.
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: () {
}
));

onError

An error occurred.
Note:
This callback indicates that the SDK encountered an unrecoverable error. Such errors must be listened for, and UI reminders should be sent to users if necessary.
TUICallEngine.instance.addObserver(TUICallObserver(
onError: (int code, String message) {
}
));
The parameters are described below:
Parameter
Type
Description
code
int
The error code.
message
String
The error message.

onUserInviting

Callback when a user is invited to join a call.
TUICallEngine.instance.addObserver(TUICallObserver(
onUserInviting: (String userId) {
// TODO
}
));
The parameters are listed in the table below.
Parameter
Type
Meaning
userId
String
ID of the invited user

onCallReceived

Received a new incoming call request callback, the callee will receive it. You can listen to this event to determine whether to display the call answering interface.
TUICallEngine.instance.addObserver(TUICallObserver(
onCallReceived: (String callId, String callerId, List<String> calleeIdList, TUICallMediaType mediaType, CallObserverExtraInfo info) {
// TODO
}
));
The parameters are listed in the table below.
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

onCallNotConnected

Callback for call cancellation.
TUICallEngine.instance.addObserver(TUICallObserver(
onCallNotConnected: (String callId, TUICallMediaType mediaType, CallEndReason reason,
String userId, CallObserverExtraInfo info) {
// TODO
}
));
The parameters are listed in the table below.
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

onCallBegin

Indicates that the call is connected, and both the caller and callee can receive it. You can listen to this event to start processes such as cloud recording and content review.
TUICallEngine.instance.addObserver(TUICallObserver(
onCallBegin: (String callId, TUICallMediaType mediaType, CallObserverExtraInfo info) {
// TODO
}
));
The parameters are listed in the table below.
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

onCallEnd

Indicates that the call is connected, and both the caller and callee can receive it. You can listen to this event to display information such as call duration and call type, or to stop the cloud recording process.
TUICallEngine.instance.addObserver(TUICallObserver(
onCallEnd: (String callId, TUICallMediaType mediaType, CallEndReason reason,
String userId, double totalTime, CallObserverExtraInfo info) {
// TODO
}
));
The parameters are listed in the table below.
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
Note:
Events on the client side are generally lost due to exceptions such as process termination. If you need to complete billing logic by monitoring call duration, it is recommended to use REST API to complete such processes.

onCallMediaTypeChanged

The call type changed.
TUICallEngine.instance.addObserver(TUICallObserver(
onCallMediaTypeChanged: (TUICallMediaType oldCallMediaType, TUICallMediaType newCallMediaType) {
}
));
The parameters are described below:
Parameter
Type
Description
oldCallMediaType
The call type before the change.
newCallMediaType
The call type after the change.

onUserReject

The call was rejected. In a one-to-one call, only the inviter will receive this callback. In a group call, all invitees will receive this callback.
TUICallEngine.instance.addObserver(TUICallObserver(
onUserReject: (String userId) {
}
));
The parameters are described below:
Parameter
Type
Description
res.userId
String
The user ID of the invitee who rejected the call.

onUserNoResponse

A user did not respond.
TUICallEngine.instance.addObserver(TUICallObserver(
onUserNoResponse: (String userId) {
}
));
The parameters are described below:
Parameter
Type
Description
userId
String
The user ID of the invitee who did not answer.

onUserLineBusy

A user is busy.
TUICallEngine.instance.addObserver(TUICallObserver(
onUserLineBusy: (String onUserLineBusy) {
},
));
The parameters are described below:
Parameter
Type
Description
userId
String
The user ID of the invitee who is busy.

onUserJoin

A user joined the call.
TUICallEngine.instance.addObserver(TUICallObserver(
onUserJoin: (String userId) {
}
));
The parameters are described below:
Parameter
Type
Description
userId
String
The ID of the user who joined the call.

onUserLeave

A user left the call.
TUICallEngine.instance.addObserver(TUICallObserver(
onUserLeave: (String userId) {
}
));
The parameters are described below:
Parameter
Type
Description
userId
String
The ID of the user who left the call.

onUserVideoAvailable

Whether a user is sending video.
TUICallEngine.instance.addObserver(TUICallObserver(
onUserVideoAvailable: (String userId, bool isVideoAvailable) {
}
));
The parameters are described below:
Parameter
Type
Description
userId
String
The user ID.
isVideoAvailable
bool
Whether the user has video.

onUserAudioAvailable

Whether a user is sending audio.
TUICallEngine.instance.addObserver(TUICallObserver(
onUserAudioAvailable: (String userId, bool isAudioAvailable) {
}
));
The parameters are described below:
Parameter
Type
Description
userId
String
The user ID.
isAudioAvailable
bool
Whether the user has audio.

onUserVoiceVolumeChanged

The volumes of all users.
TUICallEngine.instance.addObserver(TUICallObserver(
onUserVoiceVolumeChanged: (Map<String, int> volumeMap) {
}
));
The parameters are described below:
Parameter
Type
Description
volumeMap
Map<String, int>
The volume table, which includes the volume of each user (userId). Value range: 0-100.

onUserNetworkQualityChanged

The network quality of all users.
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
}
The parameters are described below:
Parameter
Type
Description
networkQualityList
The current network conditions for all users (userId).

onKickedOffline

The current user was kicked offline:At this time, you can prompt the user with a UI message and then invoke initagain.
TUICallEngine.instance.addObserver(TUICallObserver(
onKickedOffline: () {
}
));

onUserSigExpired

The user sig is expired:At this time, you need to generate a new userSig, and then invoke initagain.
TUICallEngine.instance.addObserver(TUICallObserver(
onUserSigExpired: () {
}
));

Deprecated interfaces

onCallCancelled

The call was canceled by the inviter or timed out. This callback is received by an invitee. You can listen for this event to determine whether to show a missed call message.
This indicates that the call was canceled by the caller, timed out by the callee, rejected by the callee, or the callee was busy. There are multiple scenarios involved. You can listen to this event to achieve UI logic such as missed calls and resetting UI status.
Call cancellation by the caller: The caller receives the callback (userId is himself); the callee receives the callback (userId is the ID of the caller) .
Callee timeout: the caller will simultaneously receive the onUserNoResponse and onCallCancelled callbacks (userId is his own ID); the callee receives the onCallCancelled callback (userId is his own ID) .
Callee rejection: The caller will simultaneously receive the onUserReject and onCallCancelled callbacks (userId is his own ID); the callee receives the onCallCancelled callback (userId is his own ID) .
Callee busy: The caller will simultaneously receive the onUserLineBusy and onCallCancelled callbacks (userId is his own ID);
Abnormal interruption: The callee failed to receive the call ,he receives this callback (userId is his own ID).
TUICallEngine.instance.addObserver(TUICallObserver(
onCallCancelled: (String userId) {
}
));
The parameters are described below:
Parameter
Type
Description
userId
String
The user ID of the inviter.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック