Commit 6137e34b authored by jyx's avatar jyx

修复不能暂停视频 bug

parent 5e4b770e
...@@ -4,16 +4,10 @@ ...@@ -4,16 +4,10 @@
<swiper-item v-for="(list, index) in displaySwiperList" :key="index"> <swiper-item v-for="(list, index) in displaySwiperList" :key="index">
<view v-if="Math.abs(displayIndex-index)==0" style="height: 100%;" @click="tapVideoHover()"> <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" <tt-video-player v-if="Math.abs(displayIndex-index)==0" :id="'remmend'+list.vedioId"
: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"
:album-id="list.douyinAlbumId" :episode-id="list.douyinEpisodeId" :cloud-type="1" version="1" :album-id="list.douyinAlbumId" :episode-id="list.douyinEpisodeId" :cloud-type="1" version="1"
object-fit="contain" :controls="controls" :poster="data.coverImage" :loop="!isplay" 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" /> :show-fullscreen-btn="false" @controlstoggle="controlstoggle" @ended="ended" />
</view> </view>
<view v-if="!isqp" class="userInfo flex"> <view v-if="!isqp" class="userInfo flex">
...@@ -133,16 +127,16 @@ ...@@ -133,16 +127,16 @@
this.isFirstLoad = false this.isFirstLoad = false
this.queryList() this.queryList()
} else { } else {
tt.createVideoContext('' + this.originList[originIndex].vedioIndex, this).play(); if (this.videoContext) {
this.videoContext.play()
// this.videoContext?.play() }
} }
}, },
stop() { stop() {
// audo.pause() if (this.videoContext) {
// this.videoContext?.pause() this.videoContext.pause()
tt.createVideoContext('' + this.originList[originIndex].vedioIndex, this).pause(); this.videoContext.stop()
}
}, },
queryList() { queryList() {
// 推荐 // 推荐
...@@ -228,20 +222,15 @@ ...@@ -228,20 +222,15 @@
this.oid = this.originList.length - 1 this.oid = this.originList.length - 1
} }
console.log('++++++++++++上一条播放数据 Index:', this.oid) console.log('++++++++++++上一条播放数据 Index:', this.oid)
// audo.pause() if (this.videoContext) {
// this.videoContext = uni.createVideoContext("" + this.originList[this.oid].vedioId, this) this.videoContext.pause()
// this.videoContext.pause() this.videoContext.stop()
// this.videoContext.stop() }
tt.createVideoContext('' + this.originList[this.oid].vedioIndex, this).pause();
setTimeout(() => { setTimeout(() => {
console.log('qqqqqq:', this.originList[originIndex].vedioId) console.log('qqqqqq:', this.originList[originIndex].vedioId)
// this.videoContext = uni.createVideoContext("" + this.originList[originIndex].vedioId, this) this.videoContext = tt.createVideoContext('remmend' + this.originList[originIndex].vedioId)
// this.videoContext.play() this.videoContext.play()
tt.createVideoContext('' + this.originList[originIndex].vedioIndex, this).play();
}, 500) }, 500)
var pCount = this.originList.length - this.playCount var pCount = this.originList.length - this.playCount
if (originIndex == pCount) { if (originIndex == pCount) {
......
...@@ -65,8 +65,6 @@ ...@@ -65,8 +65,6 @@
handler: function(newVal, oldVal) { handler: function(newVal, oldVal) {
if (newVal) { if (newVal) {
this.handleShow(); this.handleShow();
} else {
this.$refs.kefuPop.close('bottom');
} }
}, },
immediate: true immediate: true
......
...@@ -12,12 +12,6 @@ ...@@ -12,12 +12,6 @@
:show-fullscreen-btn="false" @controlstoggle="controlstoggle" @timeupdate="timeUpdate" :show-fullscreen-btn="false" @controlstoggle="controlstoggle" @timeupdate="timeUpdate"
@ended="ended" /> @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" <view v-if="originList[originIndex].lock || !list.vedioUrl" class="videoHover tsimg"
@click.stop="tapVideoHover(index,list.pays)" @click.stop="tapVideoHover(index,list.pays)"
:style="'width: '+ windowWidth +'px; height:'+100+'%;'"> :style="'width: '+ windowWidth +'px; height:'+100+'%;'">
...@@ -180,15 +174,6 @@ ...@@ -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: { methods: {
startPlay() { startPlay() {
if (tt.canIUse('preloadResourceVideo')) { if (tt.canIUse('preloadResourceVideo')) {
...@@ -249,7 +234,7 @@ ...@@ -249,7 +234,7 @@
govip() { govip() {
navigateTo(`/pagesA/vipPay/vipPay`) navigateTo(`/pagesA/vipPay/vipPay`)
}, },
timeupdate(event) {}, timeUpdate(event) {},
selectThisVideo(index) { selectThisVideo(index) {
if (this.originIndex == index) { if (this.originIndex == index) {
return 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