Browse Source

萤石播放器 89.9%

release_0.0.2
巴林闲侠 3 years ago
parent
commit
09f72f5c9d
  1. 12
      code/VideoAccess-VCMP/api/app/lib/service/socket.js
  2. 2
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperationHistroyProcess.jsx
  3. 4
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx
  4. 8
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx

12
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('TEST', { someProperty: '【广播】呼叫青铜时代号!!!', })
app.socket.emit('CAMERA_ONLINE', { // app.socket.emit('CAMERA_ONLINE', {
ipctype: 'yingshi', // ipctype: 'yingshi',
online: Math.random() > 0.5 ? 'ON' : 'OFF', // online: Math.random() > 0.5 ? 'ON' : 'OFF',
gbId: Math.floor(Math.random() * 100), // gbId: Math.floor(Math.random() * 100),
name: 'cameraName' // name: 'cameraName'
}) // })
}, 3000) }, 3000)
} }

2
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperationHistroyProcess.jsx

@ -56,8 +56,6 @@ const videoOperationHistroyProcess = ({ processDisX, setProcessDisX, histroyTime
} else if (x > parentWidth) { } else if (x > parentWidth) {
x = parentWidth x = parentWidth
} }
console.log(parentWidth, x);
setProcessDisX(x) setProcessDisX(x)
setProcessDisXRatio(x / parentWidth) setProcessDisXRatio(x / parentWidth)
point.style.left = x + 'px'; point.style.left = x + 'px';

4
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx

@ -151,6 +151,8 @@ const VideoPlay = ({
.format(timeFormat) .format(timeFormat)
) )
}, 300) }, 300)
} else {
document.getElementById('process_point').style.left = processDisX + 'px'
} }
} }
}, [processDisX]) }, [processDisX])
@ -211,8 +213,10 @@ const VideoPlay = ({
{/* 顶部信息 */} {/* 顶部信息 */}
<VideoHeader <VideoHeader
operationState={operationState} changeSelectState={changeSelectState} operationState={operationState} changeSelectState={changeSelectState}
histroyTime={histroyTime}
setoperationState={setoperationState} name={name} setoperationState={setoperationState} name={name}
showTime={histroyBegain} showTime={histroyBegain}
setProcessDisX={setProcessDisX}
/> />
{/* 视频内容 */} {/* 视频内容 */}
{ {

8
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 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 time = useRef(moment(showTime || undefined))
const upTimeInterval = useRef(null) const upTimeInterval = useRef(null)
const [showTime_, setShowTime] = useState(time.current.format(timeFormat)) const [showTime_, setShowTime] = useState(time.current.format(timeFormat))
@ -20,6 +20,12 @@ const VideoHeader = ({ operationState, changeSelectState, setoperationState, nam
} }
const upTime = () => { const upTime = () => {
time.current.add(1, 's') 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)) setShowTime(time.current.format(timeFormat))
} }
upTime() upTime()

Loading…
Cancel
Save