Commit f8cdee82 authored by 刘梦焕's avatar 刘梦焕

feat: 视频组件接入云台控制接口

parent 73781d6a
...@@ -155,7 +155,7 @@ class App extends React.Component { ...@@ -155,7 +155,7 @@ class App extends React.Component {
return ( return (
<div className={style.containerOut}> <div className={style.containerOut}>
{<div className={style.container} key={VideoInfo.id} ref={`myVideo` + VideoInfo.id}> {<div className={style.container} key={VideoInfo.id} ref={`myVideo` + VideoInfo.id}>
{isShowControl && <CloudPlate onClose={() => this.closeCloudPlate()} />} {isShowControl && <CloudPlate videoInfo={VideoInfo} onClose={() => this.closeCloudPlate()} />}
</div>} </div>}
</div> </div>
......
...@@ -23,3 +23,12 @@ export function newPlayback(params) { ...@@ -23,3 +23,12 @@ export function newPlayback(params) {
params, params,
}); });
} }
// 云台控制
export function controlSlim(data) {
return request({
url: `${baseURI}${CommonPath}/pandavms/camera/control/slim`,
method: REQUEST_METHOD_POST,
data,
});
}
\ No newline at end of file
import React from 'react'; import React from 'react';
import { PlusOutlined, MinusOutlined, CloseOutlined } from '@ant-design/icons'; import { PlusOutlined, MinusOutlined, CloseOutlined } from '@ant-design/icons';
import classNames from 'classnames'; import classNames from 'classnames';
import { notification } from 'antd';
import { controlSlim } from '../apis/index';
import styles from './CloudPlate.less'; import styles from './CloudPlate.less';
const CloudPlate = (props) => { const CloudPlate = (props) => {
const { onClose } = props; const { onClose, videoInfo } = props;
const dotCount = 8; // 点的数量 const dotCount = 8; // 点的数量
const radius = 55; // 圆的半径 const radius = 55; // 圆的半径
...@@ -18,17 +20,28 @@ const CloudPlate = (props) => { ...@@ -18,17 +20,28 @@ const CloudPlate = (props) => {
return { top, left }; return { top, left };
}; };
// 0-上,1-下,2-左,3-右,4-左上,5-左下,6-右上,7-右下 // 0-上,1-下,2-左,3-右,4-左上,5-左下,6-右上,7-右下,8-变倍+,9-变倍-,10-焦距+,11-焦距-,12-光圈+,13-光圈-
// 3-右,7-右下,1-下,5-左下,2-左,4-左上,0-上,6-右上 // 3-右,7-右下,1-下,5-左下,2-左,4-左上,0-上,6-右上
const directionList = [3, 7, 1, 5, 2, 4, 0, 6]; const directionList = [3, 7, 1, 5, 2, 4, 0, 6];
const handleControl = (num) => { // 触发控制接口
// if(!videoList.length) return false; const handleControl = async (num) => {
// ezvizPtzMove({ var formData = new FormData();
// id: videoList[curVideoInd - 1].vmS_DeviceID, const data = {
// direction: num, id: videoInfo.id,
// siteCode: window.globalConfig.userInfo.LocalSite || window.globalConfig.userInfo.site, direction: num,
// }).then((data) => {}).catch((err) => {}) 'site-code': window?.globalConfig?.userInfo?.LocalSite || 'site_ir0904fx',
};
for (const key in data) {
formData.append(key, data[key]);
}
const res = await controlSlim(formData);
if (res.code !== 200) {
notification.error({
message: '操作失败',
description: res?.msg ?? '',
});
}
}; };
return ( return (
<div className={styles['cloud-plate']}> <div className={styles['cloud-plate']}>
...@@ -105,7 +118,7 @@ const CloudPlate = (props) => { ...@@ -105,7 +118,7 @@ const CloudPlate = (props) => {
<div <div
className={styles['opera-btn']} className={styles['opera-btn']}
onClick={() => { onClick={() => {
handleControl(10); handleControl(12);
}} }}
> >
<PlusOutlined /> <PlusOutlined />
...@@ -113,7 +126,7 @@ const CloudPlate = (props) => { ...@@ -113,7 +126,7 @@ const CloudPlate = (props) => {
<div <div
className={styles['opera-btn']} className={styles['opera-btn']}
onClick={() => { onClick={() => {
handleControl(11); handleControl(13);
}} }}
> >
<MinusOutlined /> <MinusOutlined />
......
...@@ -38,13 +38,13 @@ const Demo1 = (props) => { ...@@ -38,13 +38,13 @@ const Demo1 = (props) => {
//}; //};
let VideoParam = { let VideoParam = {
id: 'B1C0D641-81B2-494C-ADAF-7240B9B69F47', id: '30E1F9B0-78C2-4947-9C9A-43C86A6678D4',
name: '登科华府_通道_4', name: '武汉测试',
protocol: '萤石云HTTP-FLV', protocol: '萤石云HTTP-FLV',
username: '6c44c8e92d1c4d75a9818756025df550', username: '6c44c8e92d1c4d75a9818756025df550',
password: '8b7dc88f9f4bf19c2b1aabfdd995244', password: '78b7dc88f9f4bf19c2b1aabfdd995244',
pandavmsHost: 'ws://192.168.10.182:7000/', pandavmsHost: 'ws://192.168.8.30:7000/',
address: 'D36342925', address: 'C83178215',
}; };
/*{ /*{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment