Fix:多视频只能播放一个

This commit is contained in:
modendeveloper
2024-12-18 23:34:57 +08:00
parent 27c95042d4
commit 78e0937fca
2 changed files with 38 additions and 4 deletions
+6 -1
View File
@@ -5,6 +5,7 @@
<image v-if="townInfo.coverType === 1" :src="townInfo.cover" mode="scaleToFill" class="img"></image>
<video
v-if="townInfo.coverType === 2"
id="videoCover"
class="img"
:src="townInfo.cover"
autoplay
@@ -40,7 +41,7 @@
<culture :list="townInfo.cultureInfo.cultureImages"></culture>
</view>
<view v-if="actived === 3">
<information :infoArray="activeties"></information>
<information :infoArray="activeties" @video="handleVideo"></information>
</view>
<view v-if="actived === 4">
<service :info="{...townInfo.serviceInfo, name: townInfo.name}"></service>
@@ -115,6 +116,10 @@ export default {
this.getActive()
},
methods: {
handleVideo() {
const videoCtx = uni.createVideoContext('videoCover', this)
videoCtx.pause()
},
shareImg() {
uni.showLoading()
shareTown(this.id).then(res => {