Browse Source

重复播放

dev_trial
wenlele 1 year ago
parent
commit
002bd4d961
  1. 6
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx

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

@ -105,7 +105,6 @@ const VideoPlay = ({ dispatch, actions,
const [showTime_, setShowTime] = useState('') const [showTime_, setShowTime] = useState('')
const [showTimeSelect, setShowTimeSelect] = useState(false) const [showTimeSelect, setShowTimeSelect] = useState(false)
const [playNumber, setPlayNumber] = useState(0)
const [hideFullScreenBut, setHideFullScreenBut] = useState(false) const [hideFullScreenBut, setHideFullScreenBut] = useState(false)
@ -123,6 +122,7 @@ const VideoPlay = ({ dispatch, actions,
const yingshiPlayer = useRef(null) const yingshiPlayer = useRef(null)
const jessibucas = useRef(null) const jessibucas = useRef(null)
const flvPlayer = useRef() const flvPlayer = useRef()
const playNumber = useRef(0)
@ -476,12 +476,12 @@ const VideoPlay = ({ dispatch, actions,
}, },
handleError: (e) => { // handleError: (e) => { //
console.log(e, '播放失败'); console.log(e, '播放失败');
if (playNumber > 4) { if (playNumber.current > 4) {
setNumbers(e.retcode) setNumbers(e.retcode)
videoAfter = new moment(); // videoAfter = new moment(); //
setDisappear(true) setDisappear(true)
} else { } else {
setPlayNumber(playNumber + 1) playNumber.current = playNumber.current + 1
yingshiPlayer.current.stop().then(() => { yingshiPlayer.current.stop().then(() => {
yingshiPlayer.current.play({ url: videoObj.playUrlSd }) yingshiPlayer.current.play({ url: videoObj.playUrlSd })
}) })

Loading…
Cancel
Save