[*] 日常优化
This commit is contained in:
@@ -795,6 +795,18 @@ class Taoyao extends RemoteClient {
|
|||||||
case "control::bell":
|
case "control::bell":
|
||||||
me.defaultControlBell(message);
|
me.defaultControlBell(message);
|
||||||
break;
|
break;
|
||||||
|
case "control::client::record":
|
||||||
|
me.defaultControlClientReccord(message);
|
||||||
|
break;
|
||||||
|
case "control::config::audio":
|
||||||
|
me.defaultControlConfigAudio(message);
|
||||||
|
break;
|
||||||
|
case "control::config::video":
|
||||||
|
me.defaultControlConfigVideo(message);
|
||||||
|
break;
|
||||||
|
case "control::photograph":
|
||||||
|
me.defaultControlPhotograph(message);
|
||||||
|
break;
|
||||||
case "control::wakeup":
|
case "control::wakeup":
|
||||||
me.defaultControlWakeup(message);
|
me.defaultControlWakeup(message);
|
||||||
break;
|
break;
|
||||||
@@ -1226,7 +1238,7 @@ class Taoyao extends RemoteClient {
|
|||||||
* @param {*} clientId 目标终端ID
|
* @param {*} clientId 目标终端ID
|
||||||
* @param {*} enabled 是否响铃
|
* @param {*} enabled 是否响铃
|
||||||
*/
|
*/
|
||||||
ControlBell(clientId, enabled) {
|
controlBell(clientId, enabled) {
|
||||||
this.request(protocol.buildMessage("control::bell", {
|
this.request(protocol.buildMessage("control::bell", {
|
||||||
enabled,
|
enabled,
|
||||||
to: clientId,
|
to: clientId,
|
||||||
@@ -1243,6 +1255,115 @@ class Taoyao extends RemoteClient {
|
|||||||
this.push(message);
|
this.push(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端录像信令
|
||||||
|
*
|
||||||
|
* @param {*} clientId 终端ID
|
||||||
|
* @param {*} enabled 录制状态
|
||||||
|
*/
|
||||||
|
controlClientRecord(clientId, enabled) {
|
||||||
|
const me = this;
|
||||||
|
me.request(protocol.buildMessage("control::client::record", {
|
||||||
|
to : clientId,
|
||||||
|
enabled: enabled
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端录像信令
|
||||||
|
*
|
||||||
|
* @param {*} message 信令消息
|
||||||
|
*/
|
||||||
|
defaultControlClientReccord(message) {
|
||||||
|
console.debug("终端录像", message);
|
||||||
|
this.push(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置音频信令
|
||||||
|
*
|
||||||
|
* @param {*} clientId 终端ID
|
||||||
|
* @param {*} config 音频配置
|
||||||
|
*/
|
||||||
|
controlConfigAudio(clientId, config) {
|
||||||
|
this.request(protocol.buildMessage("control::config::audio", {
|
||||||
|
...config,
|
||||||
|
to: clientId
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置音频信令
|
||||||
|
*
|
||||||
|
* @param {*} message 信令消息
|
||||||
|
*/
|
||||||
|
defaultControlConfigAudio(message) {
|
||||||
|
console.debug("配置音频", message);
|
||||||
|
this.push(message);
|
||||||
|
// TODO:配置本地音频
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置视频信令
|
||||||
|
*
|
||||||
|
* @param {*} clientId 终端ID
|
||||||
|
* @param {*} config 视频配置
|
||||||
|
*/
|
||||||
|
controlConfigVideo(clientId, config) {
|
||||||
|
this.request(protocol.buildMessage("control::config::video", {
|
||||||
|
...config,
|
||||||
|
to: clientId
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置视频信令
|
||||||
|
*
|
||||||
|
* @param {*} message 信令消息
|
||||||
|
*/
|
||||||
|
defaultControlConfigVideo(message) {
|
||||||
|
console.debug("配置视频", message);
|
||||||
|
this.push(message);
|
||||||
|
// TODO:配置本地视频
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拍照信令
|
||||||
|
*
|
||||||
|
* @param {*} clientId 终端ID
|
||||||
|
*/
|
||||||
|
controlPhotograph(clientId) {
|
||||||
|
const me = this;
|
||||||
|
me.request(protocol.buildMessage("control::photograph", {
|
||||||
|
to: clientId
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拍照信令
|
||||||
|
*
|
||||||
|
* @param {*} message 信令消息
|
||||||
|
*/
|
||||||
|
defaultControlPhotograph(message) {
|
||||||
|
console.debug("拍照", message);
|
||||||
|
this.push(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务端录像信令
|
||||||
|
*
|
||||||
|
* @param {*} clientId 终端ID
|
||||||
|
* @param {*} enabled 录制状态
|
||||||
|
*/
|
||||||
|
controlServerRecord(clientId, enabled) {
|
||||||
|
const me = this;
|
||||||
|
me.request(protocol.buildMessage("control::server::record", {
|
||||||
|
to : clientId,
|
||||||
|
roomId : me.roomId,
|
||||||
|
enabled: enabled
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 终端唤醒信令
|
* 终端唤醒信令
|
||||||
*
|
*
|
||||||
@@ -1264,47 +1385,6 @@ class Taoyao extends RemoteClient {
|
|||||||
this.push(message);
|
this.push(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 拍照
|
|
||||||
*
|
|
||||||
* @param {*} clientId 终端ID
|
|
||||||
*/
|
|
||||||
controlPhotograph(clientId) {
|
|
||||||
const me = this;
|
|
||||||
me.push(protocol.buildMessage("control::photograph", {
|
|
||||||
to: clientId
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 终端录像信令
|
|
||||||
*
|
|
||||||
* @param {*} clientId 终端ID
|
|
||||||
* @param {*} enabled 录制状态
|
|
||||||
*/
|
|
||||||
controlClientRecord(clientId, enabled) {
|
|
||||||
const me = this;
|
|
||||||
me.push(protocol.buildMessage("control::client::record", {
|
|
||||||
to : clientId,
|
|
||||||
enabled: enabled
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 服务端录像信令
|
|
||||||
*
|
|
||||||
* @param {*} clientId 终端ID
|
|
||||||
* @param {*} enabled 录制状态
|
|
||||||
*/
|
|
||||||
controlServerRecord(clientId, enabled) {
|
|
||||||
const me = this;
|
|
||||||
me.push(protocol.buildMessage("control::server::record", {
|
|
||||||
to : clientId,
|
|
||||||
roomId : me.roomId,
|
|
||||||
enabled: enabled
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 终端音量信令
|
* 终端音量信令
|
||||||
*
|
*
|
||||||
@@ -3267,3 +3347,4 @@ class Taoyao extends RemoteClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export { Taoyao };
|
export { Taoyao };
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.acgist.taoyao.controller;
|
package com.acgist.taoyao.signal.controller;
|
||||||
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -26,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
* 服务端媒体录像机
|
* 服务端媒体录像机
|
||||||
*
|
*
|
||||||
* OPUS = 100
|
* OPUS = 100
|
||||||
|
* PCMU =
|
||||||
* VP8 = 101
|
* VP8 = 101
|
||||||
* H264 = 107
|
* H264 = 107
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -21,13 +21,13 @@ import com.acgist.taoyao.signal.protocol.ProtocolControlAdapter;
|
|||||||
body = {
|
body = {
|
||||||
"""
|
"""
|
||||||
{
|
{
|
||||||
"to": "目标终端ID",
|
"to" : "目标终端ID",
|
||||||
"enabled": 是否录像(true|false)
|
"enabled": 是否录像(true|false)
|
||||||
}
|
}
|
||||||
""",
|
""",
|
||||||
"""
|
"""
|
||||||
{
|
{
|
||||||
"enabled": 是否录像(true|false),
|
"enabled" : 是否录像(true|false),
|
||||||
"filepath": "视频文件路径"
|
"filepath": "视频文件路径"
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public interface IControlBellProtocol {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param clientId 终端ID
|
* @param clientId 终端ID
|
||||||
* @param enabled 状态
|
* @param enabled 状态
|
||||||
*
|
*
|
||||||
* @return 执行结果
|
* @return 执行结果
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import com.acgist.taoyao.boot.model.Message;
|
|||||||
public interface IControlConfigAudioProtocol {
|
public interface IControlConfigAudioProtocol {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param clientId 终端ID
|
* @param clientId 终端ID
|
||||||
* @param mediaAudioProperties 音频配置
|
* @param mediaAudioProperties 音频配置
|
||||||
*
|
*
|
||||||
* @return 执行结果
|
* @return 执行结果
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import com.acgist.taoyao.boot.model.Message;
|
|||||||
public interface IControlConfigVideoProtocol {
|
public interface IControlConfigVideoProtocol {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param clientId 终端ID
|
* @param clientId 终端ID
|
||||||
* @param mediaVideoProperties 视频配置
|
* @param mediaVideoProperties 视频配置
|
||||||
*
|
*
|
||||||
* @return 执行结果
|
* @return 执行结果
|
||||||
|
|||||||
Reference in New Issue
Block a user