From f64f87546ecff2b720159aec4defc9e163400da0 Mon Sep 17 00:00:00 2001 From: modendeveloper Date: Wed, 18 Dec 2024 23:18:12 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A2889=20=E3=80=90=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E3=80=91=E4=BC=98=E5=8C=96=E5=BD=93?= =?UTF-8?q?=E5=AF=BB=E8=B6=A3=E5=91=B3=E5=BA=97=E9=93=BA=E5=B0=81=E9=9D=A2?= =?UTF-8?q?=E4=B8=BA=E8=A7=86=E9=A2=91=E6=97=B6=EF=BC=8C=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E8=B5=84=E8=AE=AF=E5=92=8C=E8=A7=86=E9=A2=91=E5=B0=81=E9=9D=A2?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E5=90=8C=E6=97=B6=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagesInn/inn/innHome.vue | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/pagesInn/inn/innHome.vue b/pagesInn/inn/innHome.vue index 1fea1e6..9010c98 100644 --- a/pagesInn/inn/innHome.vue +++ b/pagesInn/inn/innHome.vue @@ -31,6 +31,7 @@ :autoplay="true" :controls="true" :loop="false" + id="coverVideo" object-fit="contain" play-btn-position="center" class="video" @@ -232,8 +233,8 @@ controls play-btn-position="center" class="video-item" - :autoplay="inn.coverType !== 2" - @play="infoItemViewClick(item)" + :id="'video-item' + index" + @play="infoItemViewClick(item, index)" /> @@ -666,7 +667,26 @@ export default { infoClick: function (info) { // this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id) }, - infoItemViewClick(item) { + infoItemViewClick(item, index) { + if(item.type === 'NT_VIDEO') { + const coverCtx = uni.createVideoContext('coverVideo', this) + coverCtx.pause() + const playerId = 'video-item' + index + if(this.videoPlayers.includes(playerId)) { + this.videoPlayers.forEach(player => { + if(player === playerId) return + const playerCtx = uni.createVideoContext(player, this) + playerCtx.pause() + }) + } { + this.videoPlayers.push(playerId) + this.videoPlayers.forEach(player => { + if(player === playerId) return + const playerCtx = uni.createVideoContext(player, this) + playerCtx.pause() + }) + } + } uni.$u.debounce(() => { hotelNewsView({ id: item.id }).finally(() => { this.infoArray.map(info => {