[*] 日常优化
This commit is contained in:
@@ -1978,24 +1978,6 @@ class Taoyao extends RemoteClient {
|
|||||||
console.debug("视频方向变化信令", message);
|
console.debug("视频方向变化信令", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 重启平台信令
|
|
||||||
*
|
|
||||||
* @returns 响应
|
|
||||||
*/
|
|
||||||
async platformReboot() {
|
|
||||||
return await this.request(protocol.buildMessage("platform::reboot", {}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 重启平台信令
|
|
||||||
*
|
|
||||||
* @param {*} message 信令消息
|
|
||||||
*/
|
|
||||||
defaultPlatformReboot(message) {
|
|
||||||
console.debug("平台重启", message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消费媒体信令
|
* 消费媒体信令
|
||||||
*
|
*
|
||||||
@@ -2197,23 +2179,6 @@ class Taoyao extends RemoteClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 平台异常信令
|
|
||||||
*
|
|
||||||
* @param {*} message 消息
|
|
||||||
*/
|
|
||||||
defaultPlatformError(message) {
|
|
||||||
const {
|
|
||||||
code
|
|
||||||
} = message;
|
|
||||||
if (code === "3401") {
|
|
||||||
// 没有授权直接关闭
|
|
||||||
this.closeAll();
|
|
||||||
} else {
|
|
||||||
console.warn("平台异常", message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 媒体回调
|
* 媒体回调
|
||||||
*
|
*
|
||||||
@@ -2231,32 +2196,6 @@ class Taoyao extends RemoteClient {
|
|||||||
me.callback(callbackMessage);
|
me.callback(callbackMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 错误回调
|
|
||||||
*
|
|
||||||
* @param {*} message 错误消息
|
|
||||||
* @param {*} error 异常信息
|
|
||||||
*/
|
|
||||||
platformError(message, error) {
|
|
||||||
if (this.callback) {
|
|
||||||
let callbackMessage;
|
|
||||||
if(message instanceof Object) {
|
|
||||||
callbackMessage = message;
|
|
||||||
} else {
|
|
||||||
callbackMessage = protocol.buildMessage("platform::error", {});
|
|
||||||
callbackMessage.code = "9999";
|
|
||||||
callbackMessage.message = message;
|
|
||||||
}
|
|
||||||
this.callback(callbackMessage, error);
|
|
||||||
} else {
|
|
||||||
if (error) {
|
|
||||||
console.error("发生异常", message, error);
|
|
||||||
} else {
|
|
||||||
console.warn("发生错误", message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生产媒体
|
* 生产媒体
|
||||||
*
|
*
|
||||||
@@ -2759,6 +2698,67 @@ class Taoyao extends RemoteClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误回调
|
||||||
|
*
|
||||||
|
* @param {*} message 错误消息
|
||||||
|
* @param {*} error 异常信息
|
||||||
|
*/
|
||||||
|
platformError(message, error) {
|
||||||
|
if (this.callback) {
|
||||||
|
let callbackMessage;
|
||||||
|
if(message instanceof Object) {
|
||||||
|
callbackMessage = message;
|
||||||
|
} else {
|
||||||
|
callbackMessage = protocol.buildMessage("platform::error", {});
|
||||||
|
callbackMessage.code = "9999";
|
||||||
|
callbackMessage.message = message;
|
||||||
|
}
|
||||||
|
this.callback(callbackMessage, error);
|
||||||
|
} else {
|
||||||
|
if (error) {
|
||||||
|
console.error("发生异常", message, error);
|
||||||
|
} else {
|
||||||
|
console.warn("发生错误", message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台异常信令
|
||||||
|
*
|
||||||
|
* @param {*} message 消息
|
||||||
|
*/
|
||||||
|
defaultPlatformError(message) {
|
||||||
|
const {
|
||||||
|
code
|
||||||
|
} = message;
|
||||||
|
if (code === "3401") {
|
||||||
|
// 没有授权直接关闭
|
||||||
|
this.closeAll();
|
||||||
|
} else {
|
||||||
|
console.warn("平台异常", message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重启平台信令
|
||||||
|
*
|
||||||
|
* @returns 响应
|
||||||
|
*/
|
||||||
|
async platformReboot() {
|
||||||
|
return await this.request(protocol.buildMessage("platform::reboot", {}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重启平台信令
|
||||||
|
*
|
||||||
|
* @param {*} message 信令消息
|
||||||
|
*/
|
||||||
|
defaultPlatformReboot(message) {
|
||||||
|
console.debug("重启平台", message);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行命令信令
|
* 执行命令信令
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -16,7 +16,10 @@ import com.acgist.taoyao.signal.protocol.ProtocolClientAdapter;
|
|||||||
*/
|
*/
|
||||||
@Protocol
|
@Protocol
|
||||||
@Description(
|
@Description(
|
||||||
flow = "终端->信令服务->终端"
|
flow = {
|
||||||
|
"终端=>信令服务",
|
||||||
|
"信令服务->终端"
|
||||||
|
}
|
||||||
)
|
)
|
||||||
public class PlatformErrorProtocol extends ProtocolClientAdapter {
|
public class PlatformErrorProtocol extends ProtocolClientAdapter {
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
@Description(
|
@Description(
|
||||||
flow = {
|
flow = {
|
||||||
"信令服务+)终端",
|
"信令服务+)终端",
|
||||||
|
"终端=>信令服务",
|
||||||
"终端->信令服务+)终端"
|
"终端->信令服务+)终端"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
@Description(
|
@Description(
|
||||||
flow = {
|
flow = {
|
||||||
"信令服务+)终端",
|
"信令服务+)终端",
|
||||||
|
"终端=>信令服务",
|
||||||
"终端->信令服务+)终端"
|
"终端->信令服务+)终端"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user