瀏覽代碼

关闭弹窗,结束播放

liushengqiang 2 年之前
父節點
當前提交
7f35ae2079
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/subpages/colexiu-report/header/index.tsx

+ 5 - 3
src/subpages/colexiu-report/header/index.tsx

@@ -50,7 +50,7 @@ export default defineComponent({
         api: 'back',
       })
     }
-
+    const _plrl = ref()
     const autoShow = () => {
       if (localStorage.getItem('explain-view') != '1') {
         visible.value = true
@@ -99,7 +99,7 @@ export default defineComponent({
       if (isInitPlyr.value) return
       nextTick(() => {
         const id = mediaType.value === 'audio' ? '#audioSrc' : '#videoSrc'
-        const _v = new Plyr(id, {
+        _plrl.value = new Plyr(id, {
           controls: ['play-large', 'play', 'progress'],
         })
         isInitPlyr.value = true
@@ -316,7 +316,9 @@ export default defineComponent({
             </Grid>
           </Popup>
 
-          <Popup teleport="body" v-model:show={videoShow.value} class={styles.videoContent}>
+          <Popup teleport="body" v-model:show={videoShow.value} class={styles.videoContent} onClose={() => {
+            _plrl.value?.stop()
+          }}>
             <div class={styles.close} onClick={() => (videoShow.value = false)}>
               <img src={CloseIcon} />
             </div>