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'; import { log } from "ezuikit-js"; const timeFormat = 'YYYY-MM-DD HH:mm:ss' const VideoOperation = ({ ToastInCustom, operationState, operation, voiceDisY, setVoiceDisY, processDisX, setProcessDisX, isAdjustProcess, setIsAdjustProcess, resolution, setResolution, histroyTime, setHistroyTime, histroyBegain, play, pause, closeSound, openSound, isPlaying, videoObj, setYingshiPrepare, yingshiPrepareRef, slideDown, player, // setPlayer, playState, }) => { 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') } console.log(player); player.stop().then((res) => { if (resolution == 'sd') { player.play({ url: videoObj?.playUrlHd, options: { hd: true } }) } else { player.play({ url: videoObj?.playUrlSd, options: { hd: false } }) } playState = false }) setResolution(resolution == 'sd' ? 'hd' : 'sd') // setPlayer({ url: resolution == 'sd' ? videoObj?.playUrlSd : videoObj?.playUrlHd }) } 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 { p.click() }} /> }) : '' }
{ videoObj.playUrlSd && videoObj.playUrlHd ? resolution == 'sd' ?
标清
:
高清
: '' }
: '' }
) } function mapStateToProps (state) { const { auth } = state; return { user: auth.user, }; } export default connect(mapStateToProps)(VideoOperation);