From afd2cf656cbab08afe2db0ed011bf93625e1a5cc Mon Sep 17 00:00:00 2001 From: user1 <10901603+no-distractions1@user.noreply.gitee.com> Date: 星期一, 01 七月 2024 10:16:27 +0800 Subject: [PATCH] 艺术戏剧(测试 7.1) --- src/books/artAndDance/view/components/index.vue | 23 +++++++++++++++++++++-- 1 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/books/artAndDance/view/components/index.vue b/src/books/artAndDance/view/components/index.vue index 9c7b0c0..da522a6 100644 --- a/src/books/artAndDance/view/components/index.vue +++ b/src/books/artAndDance/view/components/index.vue @@ -118,7 +118,8 @@ setTimeout(() => { this.initSwiper(); this.initViewer(); - this.closeAudio() + this.closeAudio(); + this.closeVideo(); }, 200); }, }, @@ -895,7 +896,6 @@ closeMiniAudio() { this.audioPath = ""; }, - // 鐐瑰嚮闊抽鎾斁锛屽叧闂叾浠栭煶棰� closeAudio() { let allAudio = ( @@ -915,6 +915,25 @@ this.closeMiniAudio() }) } + }, + // 鐐瑰嚮瑙嗛鍏抽棴鍏朵粬 + closeVideo() { + let allVideo = ( + this.container ? this.container : document + ).querySelectorAll(".video"); + for (let index = 0; index < allVideo.length; index++) { + const item = allVideo[index]; + item.addEventListener('playing',(item) => { + const path = item.srcElement.src + const videoList = Array.from(allVideo); + for (let cindex = 0; cindex < videoList.length; cindex++) { + const citem = videoList[cindex]; + if(citem.currentSrc != path && path) { + citem.pause() + } + } + }) + } } }, components: { -- Gitblit v1.9.1