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 {
videoFront = new moment(); //
setTimeout(() => {
// setTimeout(() => {
const player = new EZUIKit.EZUIKitPlayer({
id: containerId, // ID
accessToken: videoObj?.yingshiToken,
@ -479,7 +479,7 @@ const VideoPlay = ({ dispatch, actions,
})
setPlayer(player)
yingshiPlayer.current = player
}, 0)
// }, 0)
}
}
@ -551,9 +551,11 @@ const VideoPlay = ({ dispatch, actions,
player.reSize(videoWidth, videoHeight)
}
} else {
setTimeout(() => {
if (videoObj.type == 'yingshi' && player?.pluginStatus) {
player.reSize(videoWidth, videoHeight)
}
})
}
setSize({ parentWidth: containerWidth, parentHeight: containerHeight, width: videoWidth, 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 [videoWidth, setVideoWidth] = useState(300)
const [videoHeight, setVideoHeight] = useState(200)
const [videoWidth, setVideoWidth] = useState()
const [videoHeight, setVideoHeight] = useState()
// console.log(videoObj);
useEffect(() => {
const resize_ = async () => {
try {
let video = document.getElementById('video' + videoObj.key)
if (video) {
await setVideoWidth(video.clientWidth)
await setVideoHeight(video.clientHeight)
}
} catch (error) {
console.error(error)
}
}
resize_()
window.addEventListener('resize', resize_); //
return () => {
window.removeEventListener('resize', resize_);
}
// const resize_ = async () => {
// try {
// let video = document.getElementById('video' + videoObj.key)
// if (video) {
// await setVideoWidth(video.clientWidth)
// await setVideoHeight(video.clientHeight)
// }
// } catch (error) {
// console.error(error)
// }
// }
// resize_()
// window.addEventListener('resize', resize_); //
// return () => {
// window.removeEventListener('resize', resize_);
// }
}, [])
useEffect(() => {

Loading…
Cancel
Save