TUICallEvent

The list of events that need to be monitored and processed on the access side is as follows:

Members

(static) ERROR

An error occurred within the sdk

Example
let onError = function(error) {
console.log(error)
};
tuiCallEngine.on(TUICallEvent.ERROR, onError);

(static) SDK_READY

This callback is received when the SDK enters the ready state

Example
let onSDKReady = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.SDK_READY, onSDKReady);

(static) ON_CALL_BEGIN

Indicates that the call is connected and both the caller and the called party can receive it. You can monitor this event to start cloud recording, content review and other processes.

  • Note: Support v1.4.6+ version.
Example
let handleOnCallBegin = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.ON_CALL_BEGIN, handleOnCallBegin);

(static) INVITED

Invited to a call

  • Note: Subsequent plans are abandoned, and it is recommended to use the ON_CALL_RECEIVED event.
Example
let handleNewInvitationReceived = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.INVITED, handleNewInvitationReceived);

(static) ON_CALL_RECEIVED

When a new call request event is received, the callee will receive it. You can listen to this event to decide whether to display the call answering interface.

  • Note: Support v1.4.6+ version.
Example
let handleOnCallReceived = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.ON_CALL_RECEIVED, handleOnCallReceived);

(static) USER_ACCEPT

If a user answers the call, you will receive this callback

Example
let handleUserAccept = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.USER_ACCEPT, handleUserAccept);

(static) USER_ENTER

If a user agrees to enter the call, this callback will be received

Example
let handleUserEnter = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.USER_ENTER, handleUserEnter);

(static) USER_LEAVE

If a user agrees to leave the call, this callback will be received

Example
let handleUserLeave = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.USER_LEAVE, handleUserLeave);

(static) REJECT

User refuses call

  1. In a C2C call, only the initiating party will receive a rejection callback For example, A invites B and C to join the call, but B refuses. A can receive the callback, but C cannot
  2. In an IM group call, all invitees can receive this callback For example, if A invites B and C to join the call, but B refuses, both A and C can receive the callback
Example
let handleInviteeReject = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.REJECT, handleInviteeReject);

(static) NO_RESP

No response from the invited user

  1. In a C2C call, only the initiating party will receive an unanswered callback. For example, A invites B and C to join the call, but B does not respond. A can receive the callback, but C cannot
  2. In an IM group call, all invitees can receive this callback For example, A invites B and C to join the call, but B does not respond. Both A and C can receive the callback
Example
let handleNoResponse = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.NO_RESP, handleNoResponse);

(static) LINE_BUSY

The inviting party is busy

Example
let handleLineBusy = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.LINE_BUSY, handleLineBusy);

(static) CALLING_CANCEL

You will receive it as the invited party. Receiving this callback means that the call has been cancelled

  • Note: Subsequent plans are abandoned, and it is recommended to use the ON_CALL_CANCELED event.
Example
let handleCallingCancel = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.CALLING_CANCEL, handleCallingCancel);

(static) ON_CALL_CANCELED

This event will be thrown if the call is not established. You can listen to this event to implement display logic such as missed calls and resetting UI status.

  • Note: Support v1.4.6+ version.
Example
let handleOnCallCanceled = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.ON_CALL_CANCELED, handleOnCallCanceled);

(static) KICKED_OUT

If you log in repeatedly and receive this callback, you will be kicked out of the room

Example
let handleOnKickedOut = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.KICKED_OUT, handleOnKickedOut);

(static) CALLING_TIMEOUT

You will receive it as the invited party. Receiving this callback means that the call has timed out and has not been answered

Example
let handleCallingTimeout = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.CALLING_TIMEOUT, handleCallingTimeout);

(static) CALLING_END

Receiving this callback indicates that the call is over

Example
let handleCallingEnd = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.CALLING_END, handleCallingEnd);

(static) USER_VIDEO_AVAILABLE

If the remote user turns on/off the camera, the callback will be received

Example
let handleUserVideoChange = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.USER_VIDEO_AVAILABLE, handleUserVideoChange);

(static) USER_AUDIO_AVAILABLE

If the remote user turns on/off the microphone, the callback will be received

Example
let handleUserAudioChange = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.USER_AUDIO_AVAILABLE, handleUserAudioChange);

(static) USER_VOICE_VOLUME

When the remote user's speaking volume is adjusted, this callback will be received

Example
let handleUserVoiceVolumeChange = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.USER_VOICE_VOLUME, handleUserVoiceVolumeChange);

(static) GROUP_CALL_INVITEE_LIST_UPDATE

The group chat update invitation list received this callback

Example
let handleGroupInviteeListUpdate = function(event) {
console.log(event)
};
tuiCallEngine.on(TUICallEvent.GROUP_CALL_INVITEE_LIST_UPDATE, handleGroupInviteeListUpdate);

(static) CALL_TYPE_CHANGED

The call type switch received the callback

Example
let handleCallTypeChanged = function({oldCallType, newCallType}) {
console.log(oldCallType, newCallType)
};
tuiCallEngine.on(TUICallEvent.CALL_TYPE_CHANGED, handleCallTypeChanged);

(static) DEVICED_UPDATED

Device list update

Example
let handleDeviceUpdated = function({ microphoneList, cameraList, currentMicrophone, currentCamera}) {
console.log(microphoneList, cameraList, currentMicrophone, currentCamera)
};
tuiCallEngine.on(TUICallEvent.DEVICED_UPDATED, handleDeviceUpdated);

(static) MESSAGE_SENT_BY_ME

Send messages from the user

Example
let handleMessageSentByMe = function(event:any) {
console.log(event);
};
tuiCallEngine.on(TUICallEvent.MESSAGE_SENT_BY_ME, handleMessageSentByMe);