소스 검색

画刊播放视频销毁问题

natasha 1 년 전
부모
커밋
d0f681a6f7
2개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/components/common/AudioLine.vue
  2. 2 0
      src/views/bookShelf/components/MagazineVideo.vue

+ 3 - 1
src/components/common/AudioLine.vue

@@ -401,7 +401,9 @@ export default {
             item.pause();
           }
         });
-        this.$refs[audioId].play();
+        setTimeout(() => {
+          this.$refs[audioId].play();
+        }, 20);
       }
     },
     // 将整数转换成 时:分:秒的格式

+ 2 - 0
src/views/bookShelf/components/MagazineVideo.vue

@@ -29,6 +29,8 @@ export default {
   methods: {
     // 关闭
     closeWord() {
+      this.player.destroy();
+      this.player = null;
       this.$emit("closeWord");
     },
   },