|
@ -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() |
|
|