[+] 设备录像状态

This commit is contained in:
acgist
2023-06-11 09:06:33 +08:00
parent 0908996fb0
commit b19579a666
11 changed files with 71 additions and 18 deletions

View File

@@ -5,3 +5,7 @@
* [mediasoup-client源码](https://github.com/versatica/mediasoup-client)
* [mediasoup-client文档](https://mediasoup.org/documentation/v3/mediasoup-client)
* [mediasoup-client接口](https://mediasoup.org/documentation/v3/mediasoup-client/api)
## 状态维护
`Web`终端并未对整个终端列表以及状态进行维护,所以需要开发者自己实现。

View File

@@ -149,8 +149,8 @@ export default {
window.taoyao = me.taoyao;
},
async loadList() {
this.rooms = await this.taoyao.roomList();
this.medias = await this.taoyao.mediaList();
this.rooms = await this.taoyao.roomList();
this.medias = await this.taoyao.mediaList();
this.clients = await this.taoyao.clientList();
},
async roomLeave() {

View File

@@ -76,6 +76,9 @@ export default {
this.audio = this.$refs.audio;
this.video = this.$refs.video;
this.client.proxy = this;
const status = this.taoyao.clientStatus(this.client.clientId);
this.clientRecord = status.clientRecording;
this.serverRecord = status.serverRecording;
},
props: {
"client": {

View File

@@ -74,6 +74,9 @@ export default {
this.audio = this.$refs.audio;
this.video = this.$refs.video;
this.client.proxy = this;
const status = this.taoyao.clientStatus(this.client.clientId);
this.clientRecord = status.clientRecording;
this.serverRecord = status.serverRecording;
},
props: {
"client": {

View File

@@ -403,12 +403,16 @@ class RemoteClient {
audioTrack;
// 视频Track
videoTrack;
// 终端录制状态
clientRecording;
// 服务端录制状态
serverRecording;
constructor({
name,
clientId,
}) {
this.name = name;
this.name = name;
this.clientId = clientId;
}
@@ -1761,9 +1765,16 @@ class Taoyao extends RemoteClient {
);
return response.body;
}
async clientList() {
async clientStatus(clientId) {
const response = await this.request(
protocol.buildMessage("client::list", { roomId: self.roomId })
protocol.buildMessage("client::list", { clientId })
);
return response.body;
}
async roomClientList() {
const me = this;
const response = await this.request(
protocol.buildMessage("room::client::list", { roomId: me.roomId })
);
return response.body;
}