| | |
| | | this.initSwiper(); |
| | | this.initViewer(); |
| | | this.closeAudio() |
| | | this.closeVideo() |
| | | }, 200); |
| | | }, |
| | | }, |
| | |
| | | closeMiniAudio() { |
| | | this.audioPath = ""; |
| | | }, |
| | | |
| | | // 点击音频播放,关闭其他音频 |
| | | closeAudio() { |
| | | let allAudio = ( |
| | |
| | | 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: { |