diff --git a/code/VideoAccess-VCMP/api/app/lib/service/socket.js b/code/VideoAccess-VCMP/api/app/lib/service/socket.js index 52587c2..eb5cc58 100644 --- a/code/VideoAccess-VCMP/api/app/lib/service/socket.js +++ b/code/VideoAccess-VCMP/api/app/lib/service/socket.js @@ -23,11 +23,11 @@ module.exports = async function factory (app, opts) { // app.socket.emit('TEST', { someProperty: '【广播】呼叫青铜时代号!!!', }) - app.socket.emit('CAMERA_ONLINE', { - ipctype: 'yingshi', - online: Math.random() > 0.5 ? 'ON' : 'OFF', - gbId: Math.floor(Math.random() * 100), - name: 'cameraName' - }) + // app.socket.emit('CAMERA_ONLINE', { + // ipctype: 'yingshi', + // online: Math.random() > 0.5 ? 'ON' : 'OFF', + // gbId: Math.floor(Math.random() * 100), + // name: 'cameraName' + // }) }, 3000) } diff --git a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperationHistroyProcess.jsx b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperationHistroyProcess.jsx index f35db42..e0babb9 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperationHistroyProcess.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperationHistroyProcess.jsx @@ -56,8 +56,6 @@ const videoOperationHistroyProcess = ({ processDisX, setProcessDisX, histroyTime } else if (x > parentWidth) { x = parentWidth } - console.log(parentWidth, x); - setProcessDisX(x) setProcessDisXRatio(x / parentWidth) point.style.left = x + 'px'; 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 802e169..894d4a1 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx @@ -151,6 +151,8 @@ const VideoPlay = ({ .format(timeFormat) ) }, 300) + } else { + document.getElementById('process_point').style.left = processDisX + 'px' } } }, [processDisX]) @@ -211,8 +213,10 @@ const VideoPlay = ({ {/* 顶部信息 */} {/* 视频内容 */} { diff --git a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx index 1867d93..1c90e1f 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx @@ -8,7 +8,7 @@ import './videoPlay.less'; const timeFormat = 'YYYY-MM-DD HH:mm:ss' -const VideoHeader = ({ operationState, changeSelectState, setoperationState, name, showTime }) => { +const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name, showTime, histroyTime }) => { const time = useRef(moment(showTime || undefined)) const upTimeInterval = useRef(null) const [showTime_, setShowTime] = useState(time.current.format(timeFormat)) @@ -20,6 +20,12 @@ const VideoHeader = ({ operationState, changeSelectState, setoperationState, nam } const upTime = () => { time.current.add(1, 's') + if (operationState && operationState.histroy.select) { + // setProcessDisX(Math.random() * 300 + 100) + setProcessDisX( + time.current.diff(moment(histroyTime[0]), 'seconds') / moment(histroyTime[1]).diff(moment(histroyTime[0]), 'seconds') * document.getElementById('process_point').parentElement.offsetWidth + ) + } setShowTime(time.current.format(timeFormat)) } upTime()