private val observer: TUICallObserver = object : TUICallObserver() {override fun onCallBegin(roomId: TUICommonDefine.RoomId?, callMediaType: TUICallDefine.MediaType?, callRole: TUICallDefine.Role?) {}override fun onCallEnd(roomId: TUICommonDefine.RoomId?, callMediaType: TUICallDefine.MediaType?, callRole: TUICallDefine.Role?, totalTime: Long) {}override fun onUserNetworkQualityChanged(networkQualityList: MutableList<TUICommonDefine.NetworkQualityInfo>?) {}}private fun initData() {TUICallEngine.createInstance(context).addObserver(observer)}
private TUICallObserver observer = new TUICallObserver() {@Overridepublic void onCallBegin(TUICommonDefine.RoomId roomId, TUICallDefine.MediaType callMediaType, TUICallDefine.Role callRole) {}public void onCallEnd(TUICommonDefine.RoomId roomId, TUICallDefine.MediaType callMediaType,TUICallDefine.Role callRole, long totalTime) {}public void onUserNetworkQualityChanged(List<TUICommonDefine.NetworkQualityInfo> networkQualityList) {}};private void initData(){TUICallEngine.createInstance(context).addObserver(observer);}
import TUICallEngineTUICallEngine.createInstance().addObserver(self)public func onCallBegin(roomId: TUIRoomId, callMediaType: TUICallMediaType, callRole: TUICallRole) {}public func onCallEnd(roomId: TUIRoomId, callMediaType: TUICallMediaType, callRole: TUICallRole, totalTime: Float) {}public func onUserNetworkQualityChanged(networkQualityList: [TUINetworkQualityInfo]) {}
#import <TUICallEngine/TUICallEngine.h>[[TUICallEngine createInstance] addObserver:self];- (void)onCallBegin:(TUIRoomId *)roomId callMediaType:(TUICallMediaType)callMediaType callRole:(TUICallRole)callRole {}- (void)onCallEnd:(TUIRoomId *)roomId callMediaType:(TUICallMediaType)callMediaType callRole:(TUICallRole)callRole totalTime:(float)totalTime {}- (void)onUserNetworkQualityChanged:(NSArray<TUINetworkQualityInfo *> *)networkQualityList {}
TUICallObserver observer = TUICallObserver(onError: (int code, String message) {//您的回调处理逻辑}, onCallBegin: (TUIRoomId roomId, TUICallMediaType callMediaType, TUICallRole callRole) {//您的回调处理逻辑}, onCallEnd: (TUIRoomId roomId, TUICallMediaType callMediaType, TUICallRole callRole, double totalTime) {//您的回调处理逻辑},, onUserNetworkQualityChanged: (List<TUINetworkQualityInfo> networkQualityList) {//您的回调处理逻辑}, onCallReceived: (String callerId, List<String> calleeIdList, String groupId, TUICallMediaType callMediaType) {//您的回调处理逻辑}……))TUICallEngine.instance.addObserver(observer);
本页内容是否解决了您的问题?