From a942fcd307f0247f7ee289dacb5c117d8547eefa Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Thu, 10 Aug 2023 12:33:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E8=A6=81=E8=A2=AB=E5=8A=A8?= =?UTF-8?q?=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/client/src/components/ysPlayerIframe.js | 45 +++++++++++++------ .../containers/footer/build/videoMonitor.js | 16 +++---- .../footer/leadership/left/left-center.js | 21 ++++----- .../footer/leadership/right/hudongVideo.js | 14 +++--- 4 files changed, 58 insertions(+), 38 deletions(-) diff --git a/web/client/src/components/ysPlayerIframe.js b/web/client/src/components/ysPlayerIframe.js index 3d708e08..5933d1cd 100644 --- a/web/client/src/components/ysPlayerIframe.js +++ b/web/client/src/components/ysPlayerIframe.js @@ -4,30 +4,49 @@ */ 'use strict'; -import React from 'react'; +import React, { useState } from 'react'; import { connect } from 'react-redux'; +import { PlayCircleTwoTone } from '@ant-design/icons' const YSIframePlayer = props => { const { containerId, height, width, url, autoplay, audio, videoState, ysToken } = props; + + + const [play, setPlay] = useState(false) + const at = ysToken if (!url || !at) return null; - const src = `https://open.ys7.com/ezopen/h5/iframe?audio=${audio ? '1' : '0'}&url=${url}&autoplay=${autoplay || 1}&accessToken=${at}` + // const src = `https://open.ys7.com/ezopen/h5/iframe?audio=${audio ? '1' : '0'}&url=${url}&autoplay=${autoplay || 1}&accessToken=${at}` // const src = `https://open.ys7.com/ezopen/h5/iframe?audio=1&url=${url}&autoplay=${autoplay || 1}&accessToken=${at}` + const src = `https://open.ys7.com/ezopen/h5/iframe?audio=${audio ? '1' : '0'}&url=${url}&autoplay=${play ? '1' : "0"}&accessToken=${at}` + return (
- + { + play == false ? +
+ { + setPlay(true) + }} /> +
+ : + + } { videoState && videoState.status == 0 ?
{ } useEffect(() => { - const timer = setInterval(() => { - if (pageLeft + 1 < Math.ceil(videoCenterList?.length / 3)) { - setPageLeft(pageLeft + 1) - } else { - setPageLeft(0) - } - }, 1000 * 60 * 5); - return () => clearInterval(timer); + // const timer = setInterval(() => { + // if (pageLeft + 1 < Math.ceil(videoCenterList?.length / 3)) { + // setPageLeft(pageLeft + 1) + // } else { + // setPageLeft(0) + // } + // }, 1000 * 60 * 5); + // return () => clearInterval(timer); }, [pageLeft]); diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js b/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js index 7587bf57..8fe82c94 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js @@ -28,16 +28,16 @@ const Leftcenter = ({ videoCenterList }) => { }, [videoCenterList]) useEffect(() => { - const timer = setInterval(() => { - if (num == list.length) { - setNum(1); - // setTu(list[0].img); - } else { - setNum(num + 1); - // setTu(list[num].img); - } - }, 1000 * 60 * 5); - return () => clearInterval(timer); + // const timer = setInterval(() => { + // if (num == list.length) { + // setNum(1); + // // setTu(list[0].img); + // } else { + // setNum(num + 1); + // // setTu(list[num].img); + // } + // }, 1000 * 60 * 5); + // return () => clearInterval(timer); }, [num]); const renderBody = () => { @@ -98,6 +98,7 @@ const Leftcenter = ({ videoCenterList }) => { // height={410} // width={310} url={`ezopen://open.ys7.com/${item.deviceSerial}/${item.channelNo || '1'}.hd.live`} + // url={`ezopen://open.ys7.com/${item.deviceSerial}/${item.channelNo || '1'}.live`} audio="0" ysToken={item.token} videoState={{ diff --git a/web/client/src/sections/quanju/containers/footer/leadership/right/hudongVideo.js b/web/client/src/sections/quanju/containers/footer/leadership/right/hudongVideo.js index 6f3c7670..d3c26d86 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/right/hudongVideo.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/right/hudongVideo.js @@ -163,13 +163,13 @@ class ReactCarousel extends Component { clearInterval(timer); } start = () => { //开始 - let { timer } = this.state; - timer = setInterval(() => { - this.next(); - }, 1000 * 60 * 5); - this.setState({ - timer - }) + // let { timer } = this.state; + // timer = setInterval(() => { + // this.next(); + // }, 1000 * 60 * 5); + // this.setState({ + // timer + // }) } change = (index) => { //点击下面的按钮切换当前显示的图片 let { showIndex } = this.state;