diff --git a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperation.jsx b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperation.jsx index 39b8b4a..b889ef1 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperation.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperation.jsx @@ -137,7 +137,7 @@ const VideoOperation = ({ src={`/assets/images/background/video-icon-${p.key}-${operationState[p.key].select ? 'select' : 'unselect'}.png`} height={18} style={{ marginRight: 24, cursor: 'pointer' }} - onClick={(e) => { p.click(e) }} + onClick={(e) => { p.click() }} /> }) : '' } 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 343e7fe..dae0185 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx @@ -183,21 +183,22 @@ const VideoPlay = ({ key: 'talk', hide: !(videoObj.type == 'yingshi'), click: (e) => { - console.log(e); changeSelectState('talk') } }, { key: 'fullScreen', - click: () => { + click: (fullNoChange = false) => { changeSelectState('fullScreen') let videoplay = document.getElementById("vcmp_videoplay" + videoObj.id) if (screenfull.isEnabled) { - screenfull.toggle(videoplay); - if (videoObj?.type == 'yingshi' && player) { + if (!fullNoChange) { + screenfull.toggle(videoplay); + } + if (videoObj?.type == 'yingshi' && (player || yingshiPlayer.current)) { if (operationRef.current?.fullScreen.select) { - player.reSize(screen.width, screen.height); + (player || yingshiPlayer.current).reSize(screen.width, screen.height); } else { - player.reSize(size?.width, size?.height); + (player || yingshiPlayer.current).reSize(size?.width, size?.height); } } @@ -235,20 +236,33 @@ const VideoPlay = ({ // 全屏状态监听 screenfull.on('change', (e) => { - if (e?.path[0]?.id?.includes("vcmp_videoplay")) { - if (screenfull.isFullscreen && operationRef.current && !operationRef.current['fullScreen'].select) { - changeSelectState('fullScreen') - } - if (!screenfull.isFullscreen && operationRef.current && operationRef.current['fullScreen'].select) { - changeSelectState('fullScreen') - console.log(yingshiPlayer.current); - if (yingshiPlayer.current) { - console.log(45648641); - // yingshiPlayer.current.reSize(size?.width, size?.height); + let curFullElement = screenfull.element + if (curFullElement && curFullElement.id == 'vcmp_videoplay' + videoObj.id) { + if (e?.path[0]?.id?.includes("vcmp_videoplay")) { + if (screenfull.isFullscreen && operationRef.current && !operationRef.current['fullScreen'].select) { + changeSelectState('fullScreen') + } + if (!screenfull.isFullscreen && operationRef.current && operationRef.current['fullScreen'].select) { + changeSelectState('fullScreen') + if (yingshiPlayer.current) { + console.log(45648641); + // yingshiPlayer.current.reSize(size?.width, size?.height); + } } } + } else { + setTimeout(() => { + if (operationRef.current.fullScreen.select) { + operation.find(cf => cf.key == 'fullScreen').click(true) + } + }, 0) } }); + + document.onkeydown = (e) => { + console.log(e.key); + } + // const resize_ = () => { // const VideoLocal = document.getElementById('vcmp_videoplay') // setSize({ parentWidth: VideoLocal?.clientWidth, parentHeight: VideoLocal?.clientHeight, width: VideoLocal?.clientWidth, height: VideoLocal?.clientHeight }) @@ -257,6 +271,7 @@ const VideoPlay = ({ // if (local) { // window.addEventListener('resize', resize_); //只要窗口殴大小发生像素变化就会触发 // } + return () => { if (jessibuca) { jessibuca.destroy()