【m】增加未连接时的提示

This commit is contained in:
zhangzheng
2026-03-05 11:06:08 +08:00
parent 957ab561bf
commit dfc75172b8
2 changed files with 25 additions and 1 deletions

View File

@@ -172,7 +172,9 @@ class CallStateManager {
async setUp(connectionId) {
//TODO
this.connectionId = connectionId; // 获取连接ID
// 设置状态为连接中
this.state.session.status = 'connecting';
this.notify({ type: 'CALL_STATUS_CHANGE', status: 'connecting' });
// 确保本地流已经初始化
if (!this.state.localStream) {
console.log('Local stream not available, waiting for initialization...');
@@ -196,6 +198,10 @@ class CallStateManager {
// 连接建立回调
this.renderstreaming.onConnect = () => {
// 连接建立后更新状态为ongoing
this.state.session.status = 'ongoing';
this.notify({ type: 'CALL_STATUS_CHANGE', status: 'ongoing' });
if (this.state.localStream) {
const tracks = this.state.localStream.getTracks(); // 获取本地媒体轨道
for (const track of tracks) {