视频圈
This commit is contained in:
parent
bda8436650
commit
c527fbddae
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue