视频圈

This commit is contained in:
Mr.jiang 2024-07-25 15:59:34 +08:00
parent bda8436650
commit c527fbddae
1 changed files with 9 additions and 19 deletions

View File

@ -198,11 +198,8 @@
watch:{ watch:{
async k(k,old_k){ async k(k,old_k){
// console.log(k, old_k) console.log(k, old_k)
this.progressBarPercent = 0; this.progressBarPercent = 0;
// #ifndef MP
this.clearToTime();
// #endif
this.isShow = false this.isShow = false
this.dataList[old_k].playIng = false// this.dataList[old_k].playIng = false//
this.dataList[old_k].isplay = true this.dataList[old_k].isplay = true
@ -284,6 +281,7 @@
this.boxStyle.width = this.windowWidth + 'px'//px this.boxStyle.width = this.windowWidth + 'px'//px
this.boxStyle.height = this.windowHeight - this.deleteHeight;// tabbar this.boxStyle.height = this.windowHeight - this.deleteHeight;// tabbar
this.get() // this.get() //
// #ifndef MP // #ifndef MP
this.rotateX(); this.rotateX();
// #endif // #endif
@ -292,31 +290,20 @@
onShow(){ onShow(){
console.log('回到前台'); console.log('回到前台');
if(this.dataList.length !== 0){ if(this.dataList.length !== 0){
// #ifdef MP
this.dataList[this.k].state = 'play';
uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).play()
// #endif
// #ifdef H5
if(this.isClick){ if(this.isClick){
console.log(222)
this.dataList[this.k].state = 'play'; this.dataList[this.k].state = 'play';
uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).play() uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).play()
audo.play() audo.play()
} }
// #endif
} }
}, },
onHide(){ onHide(){
// #ifdef MP
this.dataList[this.k].state = 'pause';
uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause()
// #endif
// #ifdef H5
if(this.isClick){ if(this.isClick){
this.dataList[this.k].state = 'pause'; this.dataList[this.k].state = 'pause';
uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause() uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause()
audo.pause() audo.pause()
} }
// #endif
console.log('到后台'); console.log('到后台');
}, },
@ -749,10 +736,13 @@
this.dataList[this.k].isplay = true this.dataList[this.k].isplay = true
this.dataList[this.k].playIng = true this.dataList[this.k].playIng = true
setTimeout(()=>{ setTimeout(()=>{
uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).seek(0) // uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).seek(0)
uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause() // uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause()
this.dataList[this.k].state = 'pause'; this.dataList[this.k].state = 'play';
uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).play()
audo.src = this.dataList[this.k].src; audo.src = this.dataList[this.k].src;
audo.play()
// this.dataList[this.k].state = 'pause';
},500) },500)
},200) },200)