|
@@ -39,8 +39,8 @@ function A6ybwx() {
|
|
|
objectFit: 'cover', // 视频的object-fit样式, 默认 cover
|
|
objectFit: 'cover', // 视频的object-fit样式, 默认 cover
|
|
|
loop: false, // 是否循环, 默认false
|
|
loop: false, // 是否循环, 默认false
|
|
|
autoplay: false, // 自动播放, 默认false
|
|
autoplay: false, // 自动播放, 默认false
|
|
|
- onPlay: () => { }, // 触发播放事件
|
|
|
|
|
- onPause: () => { }, // 触发暂停事件
|
|
|
|
|
|
|
+ onPlay: () => {}, // 触发播放事件
|
|
|
|
|
+ onPause: () => {}, // 触发暂停事件
|
|
|
onEnded: () => {
|
|
onEnded: () => {
|
|
|
setIsEnter(true)
|
|
setIsEnter(true)
|
|
|
playerRef.current.destroy()
|
|
playerRef.current.destroy()
|
|
@@ -48,6 +48,7 @@ function A6ybwx() {
|
|
|
onSourceEstablished: () => {
|
|
onSourceEstablished: () => {
|
|
|
if (isEnter) setVideoOk(false)
|
|
if (isEnter) setVideoOk(false)
|
|
|
setVideoOk(true)
|
|
setVideoOk(true)
|
|
|
|
|
+
|
|
|
} //有足够的数据可以播放了
|
|
} //有足够的数据可以播放了
|
|
|
}
|
|
}
|
|
|
playerRef.current = F_Video('./myData/ybwx.ts', params)
|
|
playerRef.current = F_Video('./myData/ybwx.ts', params)
|
|
@@ -68,10 +69,13 @@ function A6ybwx() {
|
|
|
}
|
|
}
|
|
|
}, [isEnter, videoOk])
|
|
}, [isEnter, videoOk])
|
|
|
|
|
|
|
|
|
|
+
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- const A6ybwxIframe = document.getElementById('A6ybwxIframe') as HTMLIFrameElement
|
|
|
|
|
- A6ybwxIframe.src = 'Beizhongshijie/index.html'
|
|
|
|
|
- }, [])
|
|
|
|
|
|
|
+ if (isEnter) {
|
|
|
|
|
+ const A6ybwxIframe = document.getElementById('A6ybwxIframe') as HTMLIFrameElement
|
|
|
|
|
+ A6ybwxIframe.src = 'Beizhongshijie/index.html'
|
|
|
|
|
+ }
|
|
|
|
|
+ }, [isEnter])
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<div className={classNames(styles.A6ybwx, isPc ? '' : styles.A6ybwxMo)}>
|
|
<div className={classNames(styles.A6ybwx, isPc ? '' : styles.A6ybwxMo)}>
|
|
@@ -94,11 +98,7 @@ function A6ybwx() {
|
|
|
<img src={require('@/assets/sgImg/icon_skip.png')} alt='' />
|
|
<img src={require('@/assets/sgImg/icon_skip.png')} alt='' />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <iframe
|
|
|
|
|
- id='A6ybwxIframe'
|
|
|
|
|
- style={{ zIndex: isEnter ? 2 : -1 }}
|
|
|
|
|
- title='A6ybwx'
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <iframe id='A6ybwxIframe' style={{ zIndex: isEnter ? 2 : -1 }} title='A6ybwx' />
|
|
|
|
|
|
|
|
<div className='BtnTabBar' style={{ display: isEnter ? 'flex' : 'none' }}>
|
|
<div className='BtnTabBar' style={{ display: isEnter ? 'flex' : 'none' }}>
|
|
|
<div className='tab1' onClick={() => setGotoTab(1)} />
|
|
<div className='tab1' onClick={() => setGotoTab(1)} />
|