[*] 日常优化
This commit is contained in:
@@ -1905,44 +1905,6 @@ class Taoyao extends RemoteClient {
|
||||
console.debug("生产者评分", message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭通道信令
|
||||
*
|
||||
* @param {*} transportId 通道ID
|
||||
*/
|
||||
mediaTransportClose(transportId) {
|
||||
const me = this;
|
||||
console.debug("关闭通道", transportId);
|
||||
me.push(protocol.buildMessage("media::transport::close", {
|
||||
roomId : me.roomId,
|
||||
transportId: transportId,
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭通道信令
|
||||
*
|
||||
* @param {*} message
|
||||
*/
|
||||
defaultMediaTransportClose(message) {
|
||||
const me = this;
|
||||
const {
|
||||
roomId,
|
||||
transportId
|
||||
} = message.body;
|
||||
if(me.recvTransport && me.recvTransport.id === transportId) {
|
||||
console.debug("关闭接收通道", transportId);
|
||||
me.recvTransport.close();
|
||||
me.recvTransport = null;
|
||||
} else if(me.sendTransport && me.sendTransport.id === transportId) {
|
||||
console.debug("关闭发送通道", transportId);
|
||||
me.sendTransport.close();
|
||||
me.sendTransport = null;
|
||||
} else {
|
||||
console.debug("关闭通道无效", transportId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产者状态信令
|
||||
*
|
||||
@@ -2519,6 +2481,42 @@ class Taoyao extends RemoteClient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭通道信令
|
||||
*
|
||||
* @param {*} transportId 通道ID
|
||||
*/
|
||||
mediaTransportClose(transportId) {
|
||||
console.debug("关闭通道", transportId);
|
||||
this.push(protocol.buildMessage("media::transport::close", {
|
||||
transportId,
|
||||
roomId: this.roomId,
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭通道信令
|
||||
*
|
||||
* @param {*} message 信令消息
|
||||
*/
|
||||
defaultMediaTransportClose(message) {
|
||||
const {
|
||||
roomId,
|
||||
transportId
|
||||
} = message.body;
|
||||
if(this.recvTransport && this.recvTransport.id === transportId) {
|
||||
console.debug("关闭接收通道", transportId);
|
||||
this.recvTransport.close();
|
||||
this.recvTransport = null;
|
||||
} else if(this.sendTransport && this.sendTransport.id === transportId) {
|
||||
console.debug("关闭发送通道", transportId);
|
||||
this.sendTransport.close();
|
||||
this.sendTransport = null;
|
||||
} else {
|
||||
console.debug("关闭通道无效", roomId, transportId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询通道状态信令
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user