更新
This commit is contained in:
@@ -564,6 +564,15 @@ const startCall = async () => {
|
||||
statusText.value = '等待初始化完成...'
|
||||
await new Promise(resolve => setTimeout(resolve, 2000))
|
||||
|
||||
// 生产包中 init 返回后引擎可能尚未挂载,短暂轮询等待 .calls 可用
|
||||
for (let i = 0; i < 6; i++) {
|
||||
if (typeof TUICallKitAPI.calls === 'function') break
|
||||
await new Promise(resolve => setTimeout(resolve, 500))
|
||||
}
|
||||
if (typeof TUICallKitAPI.calls !== 'function') {
|
||||
throw new Error('通话引擎未就绪,请关闭窗口后重试或刷新页面')
|
||||
}
|
||||
|
||||
console.log('初始化完成,显示通话界面')
|
||||
statusText.value = '准备发起通话...'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user