[*] 日常优化
This commit is contained in:
@@ -1107,23 +1107,22 @@ class Taoyao {
|
||||
* @param {*} body 消息主体
|
||||
*/
|
||||
async mediaConsumerStatus(message, body) {
|
||||
const me = this;
|
||||
const {
|
||||
roomId,
|
||||
consumerId,
|
||||
} = body;
|
||||
const room = me.rooms.get(roomId);
|
||||
const room = this.rooms.get(roomId);
|
||||
const consumer = room?.consumers.get(consumerId);
|
||||
if(consumer) {
|
||||
console.debug("查询消费者状态", consumerId);
|
||||
message.body = {
|
||||
...body,
|
||||
status: await consumer.getStats()
|
||||
};
|
||||
me.push(message);
|
||||
} else {
|
||||
console.debug("查询消费者状态(无效)", consumerId);
|
||||
if(!consumer) {
|
||||
console.debug("查询消费者状态(消费者无效)", roomId, consumerId);
|
||||
return;
|
||||
}
|
||||
console.debug("查询消费者状态", consumerId);
|
||||
message.body = {
|
||||
...body,
|
||||
status: await consumer.getStats()
|
||||
};
|
||||
this.push(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1697,19 +1697,6 @@ class Taoyao extends RemoteClient {
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询消费者状态信令
|
||||
*
|
||||
* @param {*} consumerId 消费者ID
|
||||
*/
|
||||
async mediaConsumerStatus(consumerId) {
|
||||
const me = this;
|
||||
return await me.request(protocol.buildMessage('media::consumer::status', {
|
||||
roomId: me.roomId,
|
||||
consumerId
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 消费媒体信令
|
||||
*
|
||||
@@ -1816,6 +1803,18 @@ class Taoyao extends RemoteClient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询消费者状态信令
|
||||
*
|
||||
* @param {*} consumerId 消费者ID
|
||||
*/
|
||||
async mediaConsumerStatus(consumerId) {
|
||||
return await this.request(protocol.buildMessage("media::consumer::status", {
|
||||
consumerId,
|
||||
roomId: this.roomId,
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 消费数据信令
|
||||
*
|
||||
|
||||
@@ -22,6 +22,13 @@ import com.acgist.taoyao.signal.protocol.ProtocolRoomAdapter;
|
||||
"roomId" : "房间ID",
|
||||
"consumerId": "消费者ID"
|
||||
}
|
||||
{
|
||||
"roomId" : "房间ID",
|
||||
"consumerId": "消费者ID",
|
||||
"status" : [
|
||||
...状态信息
|
||||
]
|
||||
}
|
||||
""",
|
||||
flow = "终端=>信令服务->媒体服务"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user