Commit f54731a0fe896a13c8096e44bfbe22b1544407e5
1 parent
7f3e4715
fix: close modal cancel video buffer
Showing
1 changed file
with
3 additions
and
2 deletions
| @@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
| 23 | </div> | 23 | </div> | 
| 24 | </template> | 24 | </template> | 
| 25 | <script setup lang="ts"> | 25 | <script setup lang="ts"> | 
| 26 | - import { ref, nextTick, reactive, unref } from 'vue'; | 26 | + import { ref, nextTick, reactive } from 'vue'; | 
| 27 | import { BasicModal, useModalInner } from '/@/components/Modal'; | 27 | import { BasicModal, useModalInner } from '/@/components/Modal'; | 
| 28 | import type { StreamingManageRecord, CameraModel } from '/@/api/camera/model/cameraModel'; | 28 | import type { StreamingManageRecord, CameraModel } from '/@/api/camera/model/cameraModel'; | 
| 29 | import { videoPlay } from 'vue3-video-play'; // 引入组件 | 29 | import { videoPlay } from 'vue3-video-play'; // 引入组件 | 
| @@ -68,6 +68,7 @@ | @@ -68,6 +68,7 @@ | ||
| 68 | 68 | ||
| 69 | const [register] = useModalInner( | 69 | const [register] = useModalInner( | 
| 70 | async (data: { record: CameraModel | StreamingManageRecord }) => { | 70 | async (data: { record: CameraModel | StreamingManageRecord }) => { | 
| 71 | + // setModalProps({ destroyOnClose: true }); | ||
| 71 | const { record } = data; | 72 | const { record } = data; | 
| 72 | if (record.accessMode === AccessMode.ManuallyEnter) { | 73 | if (record.accessMode === AccessMode.ManuallyEnter) { | 
| 73 | if ((record as CameraModel).videoUrl) { | 74 | if ((record as CameraModel).videoUrl) { | 
| @@ -85,8 +86,8 @@ | @@ -85,8 +86,8 @@ | ||
| 85 | } | 86 | } | 
| 86 | ); | 87 | ); | 
| 87 | const handleCancel = () => { | 88 | const handleCancel = () => { | 
| 88 | - console.log(unref(video)); | ||
| 89 | //关闭暂停播放视频 | 89 | //关闭暂停播放视频 | 
| 90 | + options.src = ''; | ||
| 90 | video.value.pause(); | 91 | video.value.pause(); | 
| 91 | }; | 92 | }; | 
| 92 | </script> | 93 | </script> |