Browse Source

ceshi

dev_trial
wenlele 2 years ago
parent
commit
9e7c52f337
  1. 113
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx

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

@ -8,7 +8,7 @@ import { Button, ToastFactory, } from '@douyinfe/semi-ui';
import VideoHeader from './voiceHeader'
import VideoOperation from './videoOperation'
import './videoPlay.less';
import EZUIKit, { log } from 'ezuikit-js'
import EZUIKit from 'ezuikit-js'
import flvjs from 'flv.js'
const timeFormat = 'YYYY-MM-DD HH:mm:ss'
@ -252,6 +252,7 @@ const VideoPlay = ({ dispatch, actions,
// }, [quanp.current])
useEffect(() => {
console.log(videoObj)
createPlay()
let nextOperationState = {}
for (let p of operation) {
@ -455,27 +456,31 @@ const VideoPlay = ({ dispatch, actions,
flvPlayer.current = flv
} else {
videoFront = new moment(); //
// const player = new EZUIKit.EZUIKitPlayer({
// id: containerId, // ID
// accessToken: videoObj?.yingshiToken,
// url: videoObj.playUrlSd,
// width: -10,
// height: -10,
// handleSuccess: (e) => { //
// setRoll(true)
// setVideoMask(false)
// playState.current = true
// videoAfter = new moment(); //
// },
// handleError: (e) => { //
// console.log(e, '');
// setNumbers(e.retcode)
// videoAfter = new moment(); //
// setDisappear(true)
// },
// })
// setPlayer(player)
// yingshiPlayer.current = player
setTimeout(() => {
const player = new EZUIKit.EZUIKitPlayer({
id: containerId, // ID
accessToken: videoObj?.yingshiToken,
url: videoObj.playUrlSd,
width: -10,
height: -10,
handleSuccess: (e) => { //
setRoll(true)
setVideoMask(false)
playState.current = true
videoAfter = new moment(); //
},
handleError: (e) => { //
console.log(e, '播放失败');
setNumbers(e.retcode)
videoAfter = new moment(); //
setDisappear(true)
},
})
setPlayer(player)
yingshiPlayer.current = player
}, 3000)
}
}
@ -581,38 +586,38 @@ const VideoPlay = ({ dispatch, actions,
setShowTime={setShowTime}
setShowTimeSelect={setShowTimeSelect}
/> */}
{/* 视频内容 */}
{
// <iframe
// frameBorder="0"
// allowFullScreen='true'
// id={containerId}
// src={
// `${yingshiUrl}?audio=${videoObj.audio && operationState && !operationState.histroy.select ? '1' : '0'}&url=${operationState && operationState.histroy.select && histroyBegain ? `${videoObj.replayUrl}?begin=${moment(histroyBegain).format("YYYYMMDDHHmmss")}&end=${moment(histroyTime[1]).format("YYYYMMDDHHmmss")}` : resolution == 'sd' ? videoObj.playUrlSd : videoObj.playUrlHd}&autoplay=${'1'}&accessToken=${videoObj.yingshiToken}`
// }
// // https://open.ys7.com/doc/zh/book/index/live_proto.html
// // {width: 400px;height: 300px;}
// width={'100%'}
// height={'100%'}
// wmode="transparent"
// style={{ pointerEvents: 'none' }}
// />
}
{
videoObj.type == 'yingshi' ?
<div id={containerId} style={{ height: '100%', width: '100%', }}></div> :
<video id={containerId}
autoplay muted
style={{ height: '100%', width: '100%', }}>
</video>
}
{/* 视频内容 */}
{
// <iframe
// frameBorder="0"
// allowFullScreen='true'
// id={containerId}
// src={
// `${yingshiUrl}?audio=${videoObj.audio && operationState && !operationState.histroy.select ? '1' : '0'}&url=${operationState && operationState.histroy.select && histroyBegain ? `${videoObj.replayUrl}?begin=${moment(histroyBegain).format("YYYYMMDDHHmmss")}&end=${moment(histroyTime[1]).format("YYYYMMDDHHmmss")}` : resolution == 'sd' ? videoObj.playUrlSd : videoObj.playUrlHd}&autoplay=${'1'}&accessToken=${videoObj.yingshiToken}`
// }
// // https://open.ys7.com/doc/zh/book/index/live_proto.html
// // {width: 400px;height: 300px;}
// width={'100%'}
// height={'100%'}
// wmode="transparent"
// style={{ pointerEvents: 'none' }}
// />
}
{
videoObj.type == 'yingshi' ?
<div id={containerId} style={{ height: '100%', width: '100%', }}></div> :
<video id={containerId}
autoplay muted
style={{ height: '100%', width: '100%', }}>
</video>
}
{/* {videoMask ? <div style={{ height: '100%', width: '100%', position: 'absolute', top: '0', left: '0', backgroundColor: 'black', color: "red", }}><div style={{ position: 'absolute', top: 'calc(60%)', left: 0, zIndex: 99, textAlign: 'center', width: '100%' }}>{written}</div></div> : ''} */}
{/* {videoMask ? <div style={{ height: '100%', width: '100%', position: 'absolute', top: '0', left: '0', backgroundColor: 'black', color: "red", }}><div style={{ position: 'absolute', top: 'calc(60%)', left: 0, zIndex: 99, textAlign: 'center', width: '100%' }}>{written}</div></div> : ''} */}
{/* 下方操作栏 */}
{/* 显示操作功能条件(宽高) */}
{/* {size?.parentWidth > 479 ?
{/* 下方操作栏 */}
{/* 显示操作功能条件(宽高) */}
{/* {size?.parentWidth > 479 ?
<VideoOperation
operationState={operationState} operation={operation}
voiceDisY={voiceDisY} setVoiceDisY={setVoiceDisY}
@ -639,9 +644,9 @@ const VideoPlay = ({ dispatch, actions,
microAppVideo={microAppVideo}
/> : ""
} */}
</div>
</div>
</div>
</div>
</>
)
}

Loading…
Cancel
Save