import React, { useState, useEffect, useRef } from "react";
import { connect } from "react-redux";
import { ysptz, gbptz } from '$utils'
import './videoPlay.less';
const VideoOperationCloudControl = ({
videoObj, iotVideoServer
}) => {
const cloudControl = (ac) => {
if (videoObj.type == 'yingshi') {
ysptz(ac, videoObj)
} else {
gbptz(ac, videoObj, iotVideoServer)
}
}
const vcmpVideo = document.getElementsByClassName('vcmp_video'+videoObj.id)?.offsetHeight;
console.log(vcmpVideo);
return (
2.5 ? 2.5 : vcmpVideo / 400})`,
}}>
{
[{
style: { top: 12, left: (148 - 24) / 2, },
click: () => { cloudControl('up') }
}, {
style: { right: 12, top: (148 - 24) / 2, },
click: () => { cloudControl('right') },
}, {
style: { bottom: 12, left: (148 - 24) / 2, },
click: () => { cloudControl('down') },
}, {
style: { left: 12, top: (148 - 24) / 2 },
click: () => { cloudControl('left') },
}].map((s, i) => {
return (

)
})
}
{
[
[{ n: '+', click: () => { cloudControl('focus_in') }, }, { n: '焦距' }, { n: '-', click: () => { cloudControl('focus_out') }, }],
[{ n: '+', click: () => { cloudControl('zoom_in') }, }, { n: '缩放' }, { n: '-', click: () => { cloudControl('zoom_out') }, }],
].map(s => {
return (
{
s.map((m, mi) => {
return (
{ m.click ? m.click() : null }}
>{m.n}
)
})
}
)
})
}
)
}
function mapStateToProps (state) {
const { auth, global } = state;
return {
user: auth.user,
iotVideoServer: global.iotVideoServer,
};
}
export default connect(mapStateToProps)(VideoOperationCloudControl);