From ba4697ac53428b2520532ad359df21ab9dcea31c Mon Sep 17 00:00:00 2001 From: wenlele Date: Wed, 3 Aug 2022 13:46:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/videoPlayer/videoPlay.jsx | 23 ++++++++----------- code/VideoAccess-VCMP/web/package.json | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx index 05e9352..1725163 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx @@ -65,7 +65,6 @@ const VideoPlay = ({ iotVideoServer, local, //是否本地调用视频 }) => { - console.log(sizeWh); const [jessibuca, setjessibuca] = useState(null) const [player, setPlayer] = useState(null) const [isPlaying, setIsPlaying] = useState(false) @@ -264,7 +263,6 @@ const VideoPlay = ({ // setYingshiPrepare('play') } }, 300) - player.stop().then(() => { player.play({ url: `${videoObj.replayUrl}?begin=${moment(Begain.current).format("YYYYMMDDHHmmss")}&end=${moment(playBackTime.current[1]).format("YYYYMMDDHHmmss")}` }) playState.current = false @@ -273,7 +271,6 @@ const VideoPlay = ({ // 随播放时间变化更新进度条 document.getElementById('process_point').style.left = processDisX - 4.5 + 'px' } - } }, [processDisX]) @@ -371,17 +368,17 @@ const VideoPlay = ({ } } - useEffect(() => { - if (!operationRef.current?.fullScreen.select) { - setSize({ parentWidth: sizeWh?.parentWidth, parentHeight: sizeWh?.parentHeight, width: width || sizeWh?.parentWidth, height: height || sizeWh?.parentHeight }) - if (videoObj.type == 'yingshi' && player && IsSize == !'true') { + useEffect(async () => { + if (!operationRef.current?.fullScreen.select && player) { + if (videoObj.type == 'yingshi' && IsSize == 'true') { + + } else { console.log(11111111111); - player.stop().then(() => { - player.play().then(() => { - player.reSize(width || sizeWh?.parentWidth, height || sizeWh?.parentHeight) - }) + console.log(sizeWh); + + await setSize({ parentWidth: sizeWh?.parentWidth, parentHeight: sizeWh?.parentHeight, width: width || sizeWh?.parentWidth, height: height || sizeWh?.parentHeight }) + player.reSize(width || sizeWh?.parentWidth, height || sizeWh?.parentHeight) - }) } } @@ -449,7 +446,7 @@ const VideoPlay = ({ // /> }
- {videoMask ?
hhktyjr6tyr5
: ''} + {videoMask ?
hhktyjr6tyr5
: ''} {/* 下方操作栏 */} diff --git a/code/VideoAccess-VCMP/web/package.json b/code/VideoAccess-VCMP/web/package.json index 92c61fc..b11736a 100644 --- a/code/VideoAccess-VCMP/web/package.json +++ b/code/VideoAccess-VCMP/web/package.json @@ -7,7 +7,7 @@ "test": "mocha", "start-vite": "cross-env NODE_ENV=developmentVite npm run start-params", "start": "cross-env NODE_ENV=development npm run start-params", - "start-params": "node server -p 5000 -u http://10.8.30.24:4000 --apiVcmpUrl http://localhost:4000 --apiAuthUrl http://10.8.30.24:4200 --apiAnxinyunUrl http://10.8.30.24:4100 --iotAuthWeb http://localhost:5200 --iotVideoServer ws://221.230.55.27:8081", + "start-params": "node server -p 5000 -u http://10.8.30.34:4000 --apiVcmpUrl http://localhost:4000 --apiAuthUrl http://10.8.30.34:4200 --apiAnxinyunUrl http://10.8.30.34:4100 --iotAuthWeb http://localhost:5200 --iotVideoServer ws://221.230.55.27:8081", "deploy": "export NODE_ENV=production&& npm run build && node server", "build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js", "build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js"