import React, { useState, useEffect, useRef } from "react"; import { connect } from "react-redux"; import moment from 'moment' import VideoOperationCloudControl from './videoOperationCloudControl' import VideoOperationTalk from './videoOperationTalk' import VideoOperationSpeed from './videoOperationSpeed' import VideoOperationVoice from './videoOperationVoice' import VideoOperationHistroyTime from './videoOperationHistroyTime' import VideoOperationHistroyProcess from "./videoOperationHistroyProcess"; import { IconPause, IconPlay } from '@douyinfe/semi-icons'; import './videoPlay.less'; const timeFormat = 'YYYY-MM-DD HH:mm:ss' const VideoOperation = ({ operationState, operation, voiceDisY, setVoiceDisY, processDisX, setProcessDisX, isAdjustProcess, setIsAdjustProcess, resolution, setResolution, histroyTime, setHistroyTime, histroyBegain, play, pause, closeSound, openSound, isPlaying, videoObj, setYingshiPrepare, yingshiPrepareRef }) => { const [showTimeSelect, setShowTimeSelect] = useState(false) const butStyle = { border: '1px solid #fff', color: '#fff', padding: '0 10px', display: 'flex', alignItems: 'center', height: '64%', marginLeft: 12, cursor: 'pointer', position: 'relative' } const changeResolution = () => { if (yingshiPrepareRef.current) { return } if (videoObj.type == 'yingshi') { yingshiPrepareRef.current = 'yingshi' setYingshiPrepare('play') } setResolution(resolution == 'sd' ? 'hd' : 'sd') } const histroySelected = operationState && operationState.histroy.select return ( <> { operationState ? operationState.control.select ? : operationState.talk.select ? : '' : '' } { showTimeSelect ? { setShowTimeSelect(false) }} histroyTime={histroyTime} setHistroyTime={setHistroyTime} setProcessDisX={setProcessDisX} /> : '' } {/* 下方操作 */}
{ histroySelected && histroyTime.length ? : '' }
{ operationState ? histroySelected ? <>
{ videoObj.type != 'yingshi' ? isPlaying ? : : '' } {histroyTime.length ? `${moment(histroyTime[0]).format(timeFormat)} / ${moment(histroyTime[1]).format(timeFormat)}` : ''}
{ videoObj.type != 'yingshi' ? : '' }
{ setShowTimeSelect(!showTimeSelect) }}>时间设置
: <>
{ operationState ? operation.map(p => { if (p.hide) return null; return }) : '' }
{ videoObj.playUrlSd && videoObj.playUrlHd ? resolution == 'sd' ?
标清
:
高清
: '' }
: '' }
) } function mapStateToProps (state) { const { auth } = state; return { user: auth.user, }; } export default connect(mapStateToProps)(VideoOperation);