API | Description |
A call occurred during the call. | |
A call invitation was received. | |
The call was canceled. | |
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. |
const TUICallEngine = uni.requireNativePlugin('TencentCloud-TUICallKit-TUICallEngine');
TUICallEngine.addEventListener('onError', (res) => {console.log('onError', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.code | Number | The error code. |
res.msg | String | The error message. |
TUICallEngine.addEventListener('onCallReceived', (res) => {console.log('onCallReceived', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.callerId | String | The user ID of the inviter. |
res.calleeIdList | Array<String> | The invitee list. |
res.groupId | String | The group ID. |
res.callMediaType | Number | Media type of the call, e.g., voice call (callMediaType = 1), video call (callMediaType = 2) |
res.userData | String | User-added extended fields. |
TUICallEngine.addEventListener('onCallCancelled', (res) => {console.log('onCallCancelled', res);});
Parameter | Type | Description |
res | Object | callback parameter |
res.userId | String | The user ID of the inviter. |
TUICallEngine.addEventListener('onCallBegin', (res) => {console.log('onCallBegin', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.roomID | Number | The room ID. |
res.callMediaType | Number | Media type of the call, e.g., voice call (callMediaType = 1), video call (callMediaType = 2) |
res.callRole | Number | The role, which can be caller or callee. |
TUICallEngine.addEventListener('onCallEnd', (res) => {console.log('onCallEnd', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.roomID | Number | The room ID. |
res.callMediaType | Number | Media type of the call, e.g., voice call (callMediaType = 1), video call (callMediaType = 2) |
res.callRole | Number | The role, which can be caller or callee. |
res.totalTime | Number | The call duration. unit: second |
TUICallEngine.addEventListener('onCallMediaTypeChanged', (res) => {console.log('onCallMediaTypeChanged', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.oldCallMediaType | Number | The call type before the change. eg. audio call(callMediaType = 1), video call(callMediaType = 2) |
res.newCallMediaType | Number | The call type after the change. eg. audio call(callMediaType = 1), video call(callMediaType = 2) |
TUICallEngine.addEventListener('onUserReject', (res) => {console.log('onUserReject', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.userId | String | The user ID of the invitee who rejected the call. |
TUICallEngine.addEventListener('onUserNoResponse', (res) => {console.log('onUserNoResponse', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.userId | String | The user ID of the invitee who did not answer. |
TUICallEngine.addEventListener('onUserLineBusy', (res) => {console.log('onUserLineBusy', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.userId | String | The user ID of the invitee who is busy. |
TUICallEngine.addEventListener('onUserJoin', (res) => {console.log('onUserJoin', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.userId | String | The ID of the user who joined the call. |
TUICallEngine.addEventListener('onUserLeave', (res) => {console.log('onUserLeave', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.userId | String | The ID of the user who left the call. |
TUICallEngine.addEventListener('onUserVideoAvailable', (res) => {console.log('onUserVideoAvailable', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.userId | String | The user ID. |
res.isVideoAvailable | boolean | Whether the user has video. |
TUICallEngine.addEventListener('onUserAudioAvailable', (res) => {console.log('onUserAudioAvailable', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.userId | String | The user ID. |
res.isAudioAvailable | boolean | Whether the user has audio. |
TUICallEngine.addEventListener('onUserVoiceVolumeChanged', (res) => {console.log('onUserVoiceVolumeChanged', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.volumeMap | Map<String, Integer> | The volume table, which includes the volume of each user (userId). Value range: 0-100. |
TUICallEngine.addEventListener('onUserNetworkQualityChanged', (res) => {console.log('onUserNetworkQualityChanged', JSON.stringify(res));});
Parameter | Type | Description |
res | Object | callback parameter |
res.networkQualityList | List | The current network conditions for all users (userId). |
login
again.TUICallEngine.addEventListener('onKickedOffline', (res) => {console.log('onKickedOffline', JSON.stringify(res));});
userSig
, and then invoke login
again.TUICallEngine.addEventListener('onUserSigExpired', (res) => {console.log('onUserSigExpired', JSON.stringify(res));});
Was this page helpful?