Commit 6137e34b authored by jyx's avatar jyx

修复不能暂停视频 bug

parent 5e4b770e
......@@ -4,16 +4,10 @@
<swiper-item v-for="(list, index) in displaySwiperList" :key="index">
<view v-if="Math.abs(displayIndex-index)==0" style="height: 100%;" @click="tapVideoHover()">
<!-- <video v-if="Math.abs(displayIndex-index)==0" :id="''+list.vedioId" :controls="controls"
:autoplay="true" :isplay="true" play-btn-position="center" :loop="!isplay" @ended="ended"
@controlstoggle="controlstoggle" :show-fullscreen-btn="false" :poster="list.coverImage"
:show-loading="true" @click="tapVideoHover()" :enable-progress-gesture="false" class="tsvideo"
:src="list.recommendUrl" object-fit="cover" /> -->
<tt-video-player v-if="Math.abs(displayIndex-index)==0" :id="list.vedioId"
<tt-video-player v-if="Math.abs(displayIndex-index)==0" :id="'remmend'+list.vedioId"
:album-id="list.douyinAlbumId" :episode-id="list.douyinEpisodeId" :cloud-type="1" version="1"
object-fit="contain" :controls="controls" :poster="data.coverImage" :loop="!isplay"
:autoplay="true" :enable-progress-gesture="false" :show-loading="true" @play="startPlay"
:autoplay="false" :enable-progress-gesture="false" :show-loading="true" @play="startPlay"
:show-fullscreen-btn="false" @controlstoggle="controlstoggle" @ended="ended" />
</view>
<view v-if="!isqp" class="userInfo flex">
......@@ -133,16 +127,16 @@
this.isFirstLoad = false
this.queryList()
} else {
tt.createVideoContext('' + this.originList[originIndex].vedioIndex, this).play();
// this.videoContext?.play()
if (this.videoContext) {
this.videoContext.play()
}
}
},
stop() {
// audo.pause()
// this.videoContext?.pause()
tt.createVideoContext('' + this.originList[originIndex].vedioIndex, this).pause();
if (this.videoContext) {
this.videoContext.pause()
this.videoContext.stop()
}
},
queryList() {
// 推荐
......@@ -228,20 +222,15 @@
this.oid = this.originList.length - 1
}
console.log('++++++++++++上一条播放数据 Index:', this.oid)
// audo.pause()
// this.videoContext = uni.createVideoContext("" + this.originList[this.oid].vedioId, this)
// this.videoContext.pause()
// this.videoContext.stop()
tt.createVideoContext('' + this.originList[this.oid].vedioIndex, this).pause();
if (this.videoContext) {
this.videoContext.pause()
this.videoContext.stop()
}
setTimeout(() => {
console.log('qqqqqq:', this.originList[originIndex].vedioId)
// this.videoContext = uni.createVideoContext("" + this.originList[originIndex].vedioId, this)
// this.videoContext.play()
tt.createVideoContext('' + this.originList[originIndex].vedioIndex, this).play();
this.videoContext = tt.createVideoContext('remmend' + this.originList[originIndex].vedioId)
this.videoContext.play()
}, 500)
var pCount = this.originList.length - this.playCount
if (originIndex == pCount) {
......
......@@ -65,9 +65,7 @@
handler: function(newVal, oldVal) {
if (newVal) {
this.handleShow();
} else {
this.$refs.kefuPop.close('bottom');
}
}
},
immediate: true
}
......
......@@ -12,12 +12,6 @@
:show-fullscreen-btn="false" @controlstoggle="controlstoggle" @timeupdate="timeUpdate"
@ended="ended" />
<!-- <video v-if="!canUseTTPlayer && Math.abs(displayIndex-index)==0" :id="list.vedioIndex"
@ended="ended" :controls="controls" :loop="!isplay" :enable-progress-gesture="false"
:show-loading="true" :show-fullscreen-btn="false" @controlstoggle="controlstoggle"
:poster="data.coverImage" @timeupdate="timeupdate" :autoplay="!list.lock" :src="list.vedioUrl"
class="tsvideo" play-btn-position="center" object-fit="contain" /> -->
<view v-if="originList[originIndex].lock || !list.vedioUrl" class="videoHover tsimg"
@click.stop="tapVideoHover(index,list.pays)"
:style="'width: '+ windowWidth +'px; height:'+100+'%;'">
......@@ -180,15 +174,6 @@
});
},
// 分享
// onShareAppMessage() {
// let result = {
// title: this.data.title,
// imageUrl: this.data.coverImage,
// path: `/pageC/ttvideo/ttVideoDetail?bookId=${this.bookData.id}`
// }
// return result;
// },
methods: {
startPlay() {
if (tt.canIUse('preloadResourceVideo')) {
......@@ -249,7 +234,7 @@
govip() {
navigateTo(`/pagesA/vipPay/vipPay`)
},
timeupdate(event) {},
timeUpdate(event) {},
selectThisVideo(index) {
if (this.originIndex == index) {
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment