Call/Device
1)EnableCamera(开关摄像头)
接口支持最低版本号:3.8.10
此接口异步返回调用结果,需要订阅 Device 事件
sub_event: EnableCamera
request
{
"jsonrpc": "2.0",
"id": "xxx",
"method": "Call/Device",
"params":{
"action": "EnableCamera",
"action_params": {
"enable": true // true 开启, false 关闭
}
},
}
response
{
"jsonrpc": "2.0",
"id":"xxx",
"method":"Call/Device",
"result":{
"error_code":0,
"message":"",
"action":"EnableCamera"
}
}
2)EnableMic(开关麦克风)
接口支持最低版本号:3.8.10
此接口异步返回调用结果,需要订阅 Device 事件
sub_event: EnableMic
request
{
"jsonrpc": "2.0",
"id": "xxx",
"method": "Call/Device",
"params":{
"action": "EnableMic",
"action_params": {
"enable": true // true 开启, false 关闭
}
},
}
response
{
"jsonrpc": "2.0",
"id":"xxx",
"method":"Call/Device",
"result":{
"error_code":0,
"message":"",
"action":"EnableMic"
}
}
3)SetSpeakerVolume(设置扬声器音量)
接口支持最低版本号:3.8.10
此接口异步返回调用结果,需要订阅 Device 事件
sub_event: SetSpeakerVolume
request
{
"jsonrpc":"2.0",
"id":"xxx",
"method":"Call/Device",
"params":{
"action":"SetSpeakerVolume",
"action_params":{
"volume":50 // 音量值,0-100
}
}
}
response
{
"jsonrpc": "2.0",
"id":"xxx",
"method":"Call/Device",
"result":{
"error_code":0,
"message":"",
"action":"SetSpeakerVolume"
}
}
4)TestSpeaker (测试扬声器)
接口支持最低版本号:3.9.150
此接口异步返回调用结果:
sub_event: SpeakerTestStateChange、SpeakerTestVolumeChange
request
{
"jsonrpc":"2.0",
"id":"xxx",
"method":"Call/Device",
"params":{
"action":"TestSpeaker"
"action_params": {
"test": true // true 开启, false 关闭
}
}
}
response
{
"jsonrpc": "2.0",
"id":"xxx",
"method":"Call/Device",
"result":{
"error_code":0,
"message":"",
"action":"CheckSpeaker"
}
}
5)TestMic (测试麦克风)
接口支持最低版本号:3.9.150
此接口异步返回调用结果:
sub_event: MicTestStateChange、MicTestVolumeChange
request
{
"jsonrpc":"2.0",
"id":"xxx",
"method":"Call/Device",
"params":{
"action":"TestMic"
"action_params": {
"test": true // true 开启, false 关闭
}
}
}
response
{
"jsonrpc": "2.0",
"id":"xxx",
"method":"Call/Device",
"result":{
"error_code":0,
"message":"",
"action":"CheckMicrophone"
}
}
6)SelectCamera(选择摄像头)
接口支持最低版本号:3.9.150
此接口异步返回调用结果, 需要订阅 Device 事件
sub_event: SelectCamera
request
{
"jsonrpc": "2.0",
"id": "xxx",
"method": "Call/Device",
"params": {
"action": "SelectCamera",
"action_params": {
"device_id": "front" //摄像头名称,如front, back, 可通过查询摄像头列表接口获取摄像头名称
}
}
}
response
{
"method": "Call/Device",
"result": {
"error_code": 0,
"action": "SelectCamera",
"message": ""
},
"id": "xxx",
"jsonrpc": "2.0"
}
7)ControlCamera (摄像头ptz控制)
接口支持最低版本号:3.9.150
此接口异步返回调用结果, 需要订阅 Device 事件
sub_event: ControlCamera
request
{
"jsonrpc": "2.0",
"id": "xxx",
"method": "Call/Device",
"params": {
"action": "ControlCamera",
"action_params": {
"type": "1", //1: 手动控制,2:自动框选,3:自动聚焦演讲者 (只有Android Room支持设置type)
"device_id": "front",//摄像头名称,如front, back, 可通过查询摄像头列表接口获取摄像头名称
"pressed": false, // ptz控制器时,标识是否停止控制器,可根据按钮触摸点击和放开。true:持续移动,false:停止移动控制
"control": "left" //ptz控制方向,具体控制参数见下表
}
}
}
control | 描述 |
---|---|
left | 左移 |
right | 右移 |
up | 上移 |
down | 下移 |
zoom_plus | 放大 |
zoom_minus | 缩小 |
type | 描述 |
---|---|
手动控制 | 左移 |
1 | 手动控制器,即下发上下左右放大缩小命令来控制器摄像头画面 |
2 | 摄像头自动对焦有人活动区域的合适大小 |
3 | 摄像头自动对焦正在讲话的人 |
response
{
"method": "Call/Device",
"result": {
"error_code": 0,
"action": "ControlCamera",
"message": ""
},
"id": "xxx",
"jsonrpc": "2.0"
}
8)SelectMic (选择麦克风)
接口支持最低版本号:3.9.150
此接口异步返回调用结果, 需要订阅 Device 事件
sub_event: SelectMic
request
{
"jsonrpc":"2.0",
"id":"xxx",
"method":"Call/Device",
"params":{
"action":"SelectMic",
"action_params":{
"device_id": "",
}
}
}
response
{
"jsonrpc": "2.0",
"id":"xxx",
"method":"Call/Device",
"result":{
"error_code":0,
"message":"",
"action":"SelectMic"
}
}
8)SelectSpeaker (选择麦克风)
接口支持最低版本号:3.9.150
此接口异步返回调用结果, 需要订阅 Device 事件
sub_event: SelectSpeaker
request
{
"jsonrpc":"2.0",
"id":"xxx",
"method":"Call/Device",
"params":{
"action":"SelectSpeaker",
"action_params":{
"device_id": "",
}
}
}
response
{
"jsonrpc": "2.0",
"id":"xxx",
"method":"Call/Device",
"result":{
"error_code":0,
"message":"",
"action":"SelectSpeaker"
}
}