[*] 优化媒体消费逻辑

This commit is contained in:
acgist
2023-03-05 16:02:46 +08:00
parent 38b7db4dfe
commit a50fb071d7
13 changed files with 173 additions and 83 deletions

View File

@@ -65,7 +65,7 @@
<el-button type="primary" :disabled="!taoyao" @click="roomActive = 'enter';roomVisible = true;">选择房间</el-button>
<el-button type="primary" :disabled="!taoyao" @click="roomActive = 'create';roomVisible = true;">创建房间</el-button>
<el-button :disabled="!taoyao || !room.roomId">邀请终端</el-button>
<el-button :disabled="!taoyao || !room.roomId">退出房间</el-button>
<el-button :disabled="!taoyao || !room.roomId">离开房间</el-button>
<el-button :disabled="!taoyao || !room.roomId" @click="roomClose()" type="danger">关闭房间</el-button>
</div>

View File

@@ -503,6 +503,9 @@ class Taoyao extends RemoteClient {
case "room::enter":
me.defaultRoomEnter(message);
break;
case "room::leave":
me.defaultRoomLeave(message);
break;
case "platform::error":
me.callbackError(message);
break;
@@ -780,6 +783,18 @@ class Taoyao extends RemoteClient {
me.remoteClients.set(clientId, new RemoteClient(status));
}
}
/**
* 离开房间信令
*
* @param {*} message
*/
defaultRoomLeave(message) {
const me = this;
const { clientId } = message.body;
me.remoteClients.delete(clientId);
console.info("终端离开:", clientId);
// TODO资源释放
}
/**
* 错误回调
*/