diff --git a/pages/town/components/information.vue b/pages/town/components/information.vue index 81b16bf..392db92 100644 --- a/pages/town/components/information.vue +++ b/pages/town/components/information.vue @@ -108,6 +108,12 @@ export default { playerCtx.pause() }) }, + handlePlayer() { + this.videoPlayers.forEach(player => { + const playerCtx = uni.createVideoContext(player, this) + playerCtx.pause() + }) + }, infoItemViewClick(item, index) { if(item.contentType === 2) { // const coverCtx = uni.createVideoContext('coverVideo', this) diff --git a/pages/town/index.vue b/pages/town/index.vue index 34f75af..76d8e9d 100644 --- a/pages/town/index.vue +++ b/pages/town/index.vue @@ -11,6 +11,7 @@ autoplay play-btn-position="center" :show-fullscreen-btn="false" + @play="handlePlay" > @@ -39,7 +40,7 @@ - + @@ -114,6 +115,9 @@ export default { this.getActive() }, methods: { + handlePlay() { + this.$refs.information.handlePlayer() + }, handleVideo() { const videoCtx = uni.createVideoContext('videoCover', this) videoCtx.pause()