[*] 日常优化
This commit is contained in:
@@ -1333,23 +1333,22 @@ class Taoyao {
|
|||||||
* @param {*} body 消息主体
|
* @param {*} body 消息主体
|
||||||
*/
|
*/
|
||||||
async mediaDataProducerStatus(message, body) {
|
async mediaDataProducerStatus(message, body) {
|
||||||
const me = this;
|
|
||||||
const {
|
const {
|
||||||
roomId,
|
roomId,
|
||||||
producerId,
|
producerId,
|
||||||
} = body;
|
} = body;
|
||||||
const room = me.rooms.get(roomId);
|
const room = this.rooms.get(roomId);
|
||||||
const dataProducer = room?.dataProducers.get(producerId);
|
const dataProducer = room?.dataProducers.get(producerId);
|
||||||
if(dataProducer) {
|
if(!dataProducer) {
|
||||||
console.debug("查询数据生产者状态", producerId);
|
console.warn("查询数据生产者状态(数据生产者无效)", roomId, producerId);
|
||||||
message.body = {
|
return;
|
||||||
...body,
|
|
||||||
status: await dataProducer.getStats()
|
|
||||||
};
|
|
||||||
me.push(message);
|
|
||||||
} else {
|
|
||||||
console.debug("查询数据生产者状态(无效)", producerId);
|
|
||||||
}
|
}
|
||||||
|
console.debug("查询数据生产者状态", producerId);
|
||||||
|
message.body = {
|
||||||
|
...body,
|
||||||
|
status: await dataProducer.getStats()
|
||||||
|
};
|
||||||
|
this.push(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1366,7 +1365,7 @@ class Taoyao {
|
|||||||
const room = this.rooms.get(roomId);
|
const room = this.rooms.get(roomId);
|
||||||
const transport = room?.transports.get(transportId);
|
const transport = room?.transports.get(transportId);
|
||||||
if(!transport) {
|
if(!transport) {
|
||||||
console.warn("重启ICE(无效通道)", transportId);
|
console.warn("重启ICE(通道无效)", roomId, transportId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.debug("重启ICE", transportId);
|
console.debug("重启ICE", transportId);
|
||||||
|
|||||||
@@ -1787,19 +1787,6 @@ class Taoyao extends RemoteClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询数据生产者状态信令
|
|
||||||
*
|
|
||||||
* @param {*} producerId 生产者ID
|
|
||||||
*/
|
|
||||||
async mediaDataProducerStatus(producerId) {
|
|
||||||
const me = this;
|
|
||||||
return await me.request(protocol.buildMessage("media::data::producer::status", {
|
|
||||||
roomId: me.roomId,
|
|
||||||
producerId
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消费媒体信令
|
* 消费媒体信令
|
||||||
*
|
*
|
||||||
@@ -2056,6 +2043,18 @@ class Taoyao extends RemoteClient {
|
|||||||
this.mediaDataProducerClose(this.dataProducer?.id);
|
this.mediaDataProducerClose(this.dataProducer?.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据生产者状态信令
|
||||||
|
*
|
||||||
|
* @param {*} producerId 生产者ID
|
||||||
|
*/
|
||||||
|
async mediaDataProducerStatus(producerId) {
|
||||||
|
return await this.request(protocol.buildMessage("media::data::producer::status", {
|
||||||
|
producerId,
|
||||||
|
roomId: this.roomId,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重启ICE信令
|
* 重启ICE信令
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -22,6 +22,13 @@ import com.acgist.taoyao.signal.protocol.ProtocolRoomAdapter;
|
|||||||
"roomId" : "房间ID",
|
"roomId" : "房间ID",
|
||||||
"producerId": "数据生产者ID"
|
"producerId": "数据生产者ID"
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
"roomId" : "房间ID",
|
||||||
|
"producerId": "生产者ID",
|
||||||
|
"status" : [
|
||||||
|
...状态信息
|
||||||
|
]
|
||||||
|
}
|
||||||
""",
|
""",
|
||||||
flow = "终端=>信令服务->媒体服务"
|
flow = "终端=>信令服务->媒体服务"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user