Browse Source

视频全屏

release_1.3.0
巴林闲侠 2 years ago
parent
commit
fd38d78dfc
  1. 2
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperation.jsx
  2. 27
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx

2
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoOperation.jsx

@ -137,7 +137,7 @@ const VideoOperation = ({
src={`/assets/images/background/video-icon-${p.key}-${operationState[p.key].select ? 'select' : 'unselect'}.png`} src={`/assets/images/background/video-icon-${p.key}-${operationState[p.key].select ? 'select' : 'unselect'}.png`}
height={18} height={18}
style={{ marginRight: 24, cursor: 'pointer' }} style={{ marginRight: 24, cursor: 'pointer' }}
onClick={(e) => { p.click(e) }} onClick={(e) => { p.click() }}
/> />
}) : '' }) : ''
} }

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

@ -183,21 +183,22 @@ const VideoPlay = ({
key: 'talk', key: 'talk',
hide: !(videoObj.type == 'yingshi'), hide: !(videoObj.type == 'yingshi'),
click: (e) => { click: (e) => {
console.log(e);
changeSelectState('talk') changeSelectState('talk')
} }
}, { }, {
key: 'fullScreen', key: 'fullScreen',
click: () => { click: (fullNoChange = false) => {
changeSelectState('fullScreen') changeSelectState('fullScreen')
let videoplay = document.getElementById("vcmp_videoplay" + videoObj.id) let videoplay = document.getElementById("vcmp_videoplay" + videoObj.id)
if (screenfull.isEnabled) { if (screenfull.isEnabled) {
if (!fullNoChange) {
screenfull.toggle(videoplay); screenfull.toggle(videoplay);
if (videoObj?.type == 'yingshi' && player) { }
if (videoObj?.type == 'yingshi' && (player || yingshiPlayer.current)) {
if (operationRef.current?.fullScreen.select) { if (operationRef.current?.fullScreen.select) {
player.reSize(screen.width, screen.height); (player || yingshiPlayer.current).reSize(screen.width, screen.height);
} else { } else {
player.reSize(size?.width, size?.height); (player || yingshiPlayer.current).reSize(size?.width, size?.height);
} }
} }
@ -235,20 +236,33 @@ const VideoPlay = ({
// //
screenfull.on('change', (e) => { screenfull.on('change', (e) => {
let curFullElement = screenfull.element
if (curFullElement && curFullElement.id == 'vcmp_videoplay' + videoObj.id) {
if (e?.path[0]?.id?.includes("vcmp_videoplay")) { if (e?.path[0]?.id?.includes("vcmp_videoplay")) {
if (screenfull.isFullscreen && operationRef.current && !operationRef.current['fullScreen'].select) { if (screenfull.isFullscreen && operationRef.current && !operationRef.current['fullScreen'].select) {
changeSelectState('fullScreen') changeSelectState('fullScreen')
} }
if (!screenfull.isFullscreen && operationRef.current && operationRef.current['fullScreen'].select) { if (!screenfull.isFullscreen && operationRef.current && operationRef.current['fullScreen'].select) {
changeSelectState('fullScreen') changeSelectState('fullScreen')
console.log(yingshiPlayer.current);
if (yingshiPlayer.current) { if (yingshiPlayer.current) {
console.log(45648641); console.log(45648641);
// yingshiPlayer.current.reSize(size?.width, size?.height); // yingshiPlayer.current.reSize(size?.width, size?.height);
} }
} }
} }
} else {
setTimeout(() => {
if (operationRef.current.fullScreen.select) {
operation.find(cf => cf.key == 'fullScreen').click(true)
}
}, 0)
}
}); });
document.onkeydown = (e) => {
console.log(e.key);
}
// const resize_ = () => { // const resize_ = () => {
// const VideoLocal = document.getElementById('vcmp_videoplay') // const VideoLocal = document.getElementById('vcmp_videoplay')
// setSize({ parentWidth: VideoLocal?.clientWidth, parentHeight: VideoLocal?.clientHeight, width: VideoLocal?.clientWidth, height: VideoLocal?.clientHeight }) // setSize({ parentWidth: VideoLocal?.clientWidth, parentHeight: VideoLocal?.clientHeight, width: VideoLocal?.clientWidth, height: VideoLocal?.clientHeight })
@ -257,6 +271,7 @@ const VideoPlay = ({
// if (local) { // if (local) {
// window.addEventListener('resize', resize_); // // window.addEventListener('resize', resize_); //
// } // }
return () => { return () => {
if (jessibuca) { if (jessibuca) {
jessibuca.destroy() jessibuca.destroy()

Loading…
Cancel
Save