Web&H5
本文介绍 TUICallKit 组件通话状态回调的使用。
通话状态监听
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);
组件回调事件
beforeCalling
: 通话开始前会执行。afterCalling
: 通话完成后执行。function App() {const handleBeforeCalling = () => {console.log("[TUICallKit Demo] beforeCalling");};const handleAfterCalling = () => {console.log("[TUICallKit Demo] afterCalling");};return (<TUICallKitbeforeCalling={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>