Browse Source

ceshi

dev_trial
wenlele 2 years ago
parent
commit
155d292140
  1. 31
      code/VideoAccess-VCMP/web/client/src/sections/openness/components/container.jsx

31
code/VideoAccess-VCMP/web/client/src/sections/openness/components/container.jsx

@ -12,8 +12,12 @@ const Container = ({ videoObj, pageSize, showHeader, videoPlay, mould }) => {
useEffect(() => {
const resize_ = async () => {
// await setVideoWidth(document.getElementById('video' + videoObj.key).clientWidth)
// await setVideoHeight(document.getElementById('video' + videoObj.key).clientHeight)
let video = document.getElementById('video' + videoObj.key)
if (video) {
await setVideoWidth(video.clientWidth)
await setVideoHeight(video.clientHeight)
}
}
resize_()
window.addEventListener('resize', resize_); //
@ -23,22 +27,25 @@ const Container = ({ videoObj, pageSize, showHeader, videoPlay, mould }) => {
}, [])
useEffect(() => {
// setVideoWidth(document.getElementById('video' + videoObj.key).clientWidth)
// setVideoHeight(document.getElementById('video' + videoObj.key).clientHeight)
let video = document.getElementById('video' + videoObj.key)
if(video){
setVideoWidth(video.clientWidth)
setVideoHeight(video.clientHeight)
}
}, [pageSize, showHeader])
// console.log(videoWidth, videoHeight);
return (
<div style={{ width: videoWidth || '100%', height: videoHeight || '100%', padding: 5 }}>
{videoWidth && videoHeight ? videoPlay ?
<VideoPlay sizeWh={{
// width: videoWidth - 10,
// height: videoHeight - 30,
// parentWidth: videoWidth - 10,
// parentHeight: videoHeight - 30,
width: 500,
height: 500,
parentWidth: 500,
parentHeight: 500,
width: videoWidth - 10,
height: videoHeight - 30,
parentWidth: videoWidth - 10,
parentHeight: videoHeight - 30,
// width: 300,
// height: 200,
// parentWidth: 300,
// parentHeight: 200,
}}
videoObj={videoObj.camera}
videoStyle='true'

Loading…
Cancel
Save