tencent cloud

Feedback

Last updated: 2024-04-03 17:23:11
    This article describes how to use call status callbacks with the TUICallKit component.

    Call State Monitoring

    If your business requires monitoring the call status, such as events during the call process ( TUICallEvent for details), you can refer to the following code:
    import { TUICallEvent } from 'tuicall-engine-webrtc';
    
    let handleUserEnter = function(event) {
    console.log('TUICallEvent.USER_ENTER: ', event);
    };
    
    TUICallKitServer.getTUICallEngineInstance().on(TUICallEvent.USER_ENTER, handleUserEnter);
    TUICallKitServer.getTUICallEngineInstance().off(TUICallEvent.USER_ENTER, handleUserEnter);

    Component Callback Event

    The TUICallKit component offers call status callbacks, which can be used to implement more interaction logic on the business side. Please refer to the TUICallKit Attribute Overview for more details.
    beforeCalling: Executed prior to the commencement of the call.
    afterCalling: Executed upon the completion of the call.
    React
    Vue
    function App() {
    const handleBeforeCalling = () => {
    console.log("[TUICallKit Demo] beforeCalling");
    };
    const handleAfterCalling = () => {
    console.log("[TUICallKit Demo] afterCalling");
    };
    return (
    <TUICallKit
    beforeCalling={handleBeforeCalling}
    afterCalling={handleAfterCalling} />
    )
    }
    <template>
    <TUICallKit
    :beforeCalling="handleBeforeCalling"
    :afterCalling="handleAfterCalling" />
    </template>
    <script setup>
    function handleBeforeCalling() {
    console.log("[TUICallKit Demo] beforeCalling");
    }
    function handleAfterCalling() {
    console.log("[TUICallKit Demo] afterCalling");
    }
    </script>
    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