Fix:2903 【商城小程序】农民店铺、村屋租售,寻趣味店铺,视频资讯播放中再点击视频封面播放,两者会出现同时播放情况

This commit is contained in:
modendeveloper
2024-12-19 23:59:15 +08:00
parent b133d0132c
commit 78c83ecaa3
5 changed files with 34 additions and 0 deletions
+7
View File
@@ -34,6 +34,7 @@
play-btn-position="center"
id="coverVideo"
class="video"
@play="coverPlay"
/>
</view>
</view>
@@ -443,6 +444,12 @@ export default {
}
})
},
coverPlay(){
this.videoPlayers.forEach(player => {
const playerCtx = uni.createVideoContext(player, this)
playerCtx.pause()
})
},
infoItemViewClick(item, index) {
if(item.type === 2) {
const coverCtx = uni.createVideoContext('coverVideo', this)
+7
View File
@@ -35,6 +35,7 @@
object-fit="contain"
play-btn-position="center"
class="video"
@play="coverPlay"
/>
</view>
</view>
@@ -668,6 +669,12 @@ export default {
infoClick: function (info) {
// this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id)
},
coverPlay(){
this.videoPlayers.forEach(player => {
const playerCtx = uni.createVideoContext(player, this)
playerCtx.pause()
})
},
infoItemViewClick(item, index) {
if(item.type === 'NT_VIDEO') {
const coverCtx = uni.createVideoContext('coverVideo', this)