tencent cloud

Feedback

TUICallEvent

Last updated: 2023-06-30 16:20:03

    TUICallEvent APIs

    TUICallEvent APIs are the callback APIs of the audio/video call component.

    Event List

    Event
    Description
    An internal error occurred.
    The SDK is ready.
    The current user was removed from the room due to repeated login.
    A user accepted the call.
    A user joined the call.
    A user left the call.
    A user rejected the call.
    The invitee user did not answer.
    The line is busy.
    A remote user turned on/off their camera.
    A remote user turned on/off their mic.
    A remote user adjusted their call volume.
    The invitation list for a group call was updated.
    You were invited to a call.
    The call was canceled (received by an invitee).
    The call ended.
    The device list was updated.
    The call type changed.

    ERROR

    An error occurred inside the SDK.
    let onError = function(error) {
    console.log(error);
    };
    tuiCallEngine.on(TUICallEvent.ERROR, onError);

    SDK_READY

    The SDK is ready.
    let onSDKReady = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.SDK_READY, onSDKReady);

    KICKED_OUT

    You were removed from the room due to repeated login.
    let handleOnKickedOut = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.KICKED_OUT, handleOnKickedOut);

    USER_ACCEPT

    A user answered the call.
    let handleUserAccept = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.USER_ACCEPT, handleUserAccept);

    USER_ENTER

    A user agreed to join the call.
    let handleUserEnter = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.USER_ENTER, handleUserEnter);

    USER_LEAVE

    A user agreed to leave the call.
    let handleUserLeave = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.USER_LEAVE, handleUserLeave);

    REJECT

    The user rejected the call.
    let handleInviteeReject = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.REJECT, handleInviteeReject);

    NO_RESP

    The invitee did not answer.
    In a one-to-one call, if the invitee does not answer, the inviter will receive this callback.
    In a group call, all invitees can receive this callback. For example, if user A invited user B and user C to a group call, and B did not answer, both A and C would receive this callback.
    let handleNoResponse = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.NO_RESP, handleNoResponse);

    LINE_BUSY

    The invitee is busy.
    let handleLineBusy = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.LINE_BUSY, handleLineBusy);

    USER_VIDEO_AVAILABLE

    A remote user turned on/off their camera.
    let handleUserVideoChange = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.USER_VIDEO_AVAILABLE, handleUserVideoChange);

    USER_AUDIO_AVAILABLE

    A remote user turned on/off their mic.
    let handleUserAudioChange = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.USER_AUDIO_AVAILABLE, handleUserAudioChange);

    USER_VOICE_VOLUME

    A remote user adjusted their call volume.
    let handleUserVoiceVolumeChange = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.USER_VOICE_VOLUME, handleUserVoiceVolumeChange);

    GROUP_CALL_INVITEE_LIST_UPDATE

    The invitee list for a group call was updated.
    let handleGroupInviteeListUpdate = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.GROUP_CALL_INVITEE_LIST_UPDATE, handleGroupInviteeListUpdate);

    INVITED

    You were invited to a call.
    let handleNewInvitationReceived = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.INVITED, handleNewInvitationReceived);

    CALLING_CANCEL

    The call was canceled. This callback is received by an invitee.
    let handleCallingCancel = function(event) {
    console.log(event)
    };
    tuiCallEngine.on(TUICallEvent.CALLING_CANCEL, handleCallingCancel);

    CALLING_END

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

    DEVICED_UPDATED

    The device list was updated.
    let handleDeviceUpdated = function({ microphoneList, cameraList, currentMicrophoneID, currentCameraID }) {
    console.log(microphoneList, cameraList, currentMicrophoneID, currentCameraID)
    };
    tuiCallEngine.on(TUICallEvent.DEVICED_UPDATED, handleDeviceUpdated);

    CALL_TYPE_CHANGED

    The call type changed.
    let handleCallTypeChanged = function({ oldCallType, newCallType }) {
    console.log(oldCallType, newCallType)
    };
    tuiCallEngine.on(TUICallEvent.CALL_TYPE_CHANGED, handleDeviceUpdated);
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support