Browse Source

建设右侧大屏视频播放

dev
dengyinhuan 3 years ago
parent
commit
0f1894e765
  1. 21
      web/client/src/sections/quanju/containers/footer/build/index.js

21
web/client/src/sections/quanju/containers/footer/build/index.js

@ -222,9 +222,7 @@ const Build = (props) => {
<div className='build-right-top'>
{/* <img src='/assets/images/quanju/xuanchuanlan.jpg'></img> */}
<Carousel dots={true} ref={lunbo} key={lunboindex} afterChange={(current)=>{
console.log(current,'嘿嘿嘿')
setlunboindex(current)}}>
<Carousel dots={false} ref={lunbo} key={lunboindex}>
{/* {
videos.map((v, i) => {
console.log('first')
@ -248,8 +246,8 @@ const Build = (props) => {
} */}
{
xuandata&&xuandata!==null&&xuandata.length!==0?xuandata.map((item,index1)=>{
if(item.enable){
xuandata&&xuandata!==null&&xuandata.length!==0?xuandata.filter(i=>i.enable).map((item,index1)=>{
if(item.video&&item.video!==null&&item.video.length!==0){
return item.video.map((i,index)=>{
// console.log(i,'视频')
@ -257,7 +255,16 @@ const Build = (props) => {
if(index1===lunboindex){
// lunbo.current.goTo(lunboindex)
console.log("自动播放",index1)
return <video src={`${localStorage.getItem("qndmn")}/${i}`} autoPlay={true} ref={lunbovideo} loop></video>
return <video src={`${localStorage.getItem("qndmn")}/${i}`} autoPlay={true} ref={lunbovideo} onEnded={()=>{
if(index1<xuandata.filter(i=>i.enable).length-1){
// console.log(index1,xuandata,'触发了')
setlunboindex(lunboindex+1)
}else{
// console.log(index1,xuandata,'触发了')
setlunboindex(0)
}
}}></video>
}else{
// console.log("不自动播放",index1)
return <video src={`${localStorage.getItem("qndmn")}/${i}`} autoPlay={false} ></video>
@ -265,7 +272,7 @@ const Build = (props) => {
})
}
// return <video src={`${localStorage.getItem("qndmn")}/${item.video!==null&&item.video.length!==0?item.video[0]:""}`} autoPlay="autoplay" loop></video>
}
})
:<video src='#'></video>
}

Loading…
Cancel
Save