Browse Source

测试1

dev_trial
wenlele 2 years ago
parent
commit
f8bcc17e95
  1. 6
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx
  2. 36
      code/VideoAccess-VCMP/web/client/src/sections/openness/components/container.jsx

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

@ -457,7 +457,7 @@ const VideoPlay = ({ dispatch, actions,
} else { } else {
videoFront = new moment(); // videoFront = new moment(); //
setTimeout(() => { // setTimeout(() => {
const player = new EZUIKit.EZUIKitPlayer({ const player = new EZUIKit.EZUIKitPlayer({
id: containerId, // ID id: containerId, // ID
accessToken: videoObj?.yingshiToken, accessToken: videoObj?.yingshiToken,
@ -479,7 +479,7 @@ const VideoPlay = ({ dispatch, actions,
}) })
setPlayer(player) setPlayer(player)
yingshiPlayer.current = player yingshiPlayer.current = player
}, 0) // }, 0)
} }
} }
@ -551,9 +551,11 @@ const VideoPlay = ({ dispatch, actions,
player.reSize(videoWidth, videoHeight) player.reSize(videoWidth, videoHeight)
} }
} else { } else {
setTimeout(() => {
if (videoObj.type == 'yingshi' && player?.pluginStatus) { if (videoObj.type == 'yingshi' && player?.pluginStatus) {
player.reSize(videoWidth, videoHeight) player.reSize(videoWidth, videoHeight)
} }
})
} }
setSize({ parentWidth: containerWidth, parentHeight: containerHeight, width: videoWidth, height: videoHeight }) setSize({ parentWidth: containerWidth, parentHeight: containerHeight, width: videoWidth, height: videoHeight })
return data == 'width' ? videoWidth : data == 'height' ? videoHeight : '' return data == 'width' ? videoWidth : data == 'height' ? videoHeight : ''

36
code/VideoAccess-VCMP/web/client/src/sections/openness/components/container.jsx

@ -6,27 +6,27 @@ import { useState } from 'react';
const Container = ({ videoObj, pageSize, showHeader, videoPlay, mould }) => { const Container = ({ videoObj, pageSize, showHeader, videoPlay, mould }) => {
const [videoWidth, setVideoWidth] = useState(300) const [videoWidth, setVideoWidth] = useState()
const [videoHeight, setVideoHeight] = useState(200) const [videoHeight, setVideoHeight] = useState()
// console.log(videoObj); // console.log(videoObj);
useEffect(() => { useEffect(() => {
const resize_ = async () => { // const resize_ = async () => {
try { // try {
let video = document.getElementById('video' + videoObj.key) // let video = document.getElementById('video' + videoObj.key)
if (video) { // if (video) {
await setVideoWidth(video.clientWidth) // await setVideoWidth(video.clientWidth)
await setVideoHeight(video.clientHeight) // await setVideoHeight(video.clientHeight)
} // }
} catch (error) { // } catch (error) {
console.error(error) // console.error(error)
} // }
} // }
resize_() // resize_()
window.addEventListener('resize', resize_); // // window.addEventListener('resize', resize_); //
return () => { // return () => {
window.removeEventListener('resize', resize_); // window.removeEventListener('resize', resize_);
} // }
}, []) }, [])
useEffect(() => { useEffect(() => {

Loading…
Cancel
Save