Commit 42d4be97ec4aaea4ee2a88f33ad8065cf9cb0deb

Authored by ww
1 parent 1c906d2d

fix: 修复视频管理列表模式预览时流未销毁

... ... @@ -24,6 +24,7 @@
24 24 }>();
25 25
26 26 function getStreamTypeByUrl(url = ''): StreamType | undefined {
  27 + url = url || '';
27 28 if (url.endsWith('.m3u8')) return 'hls';
28 29 else if (url.endsWith('.mp4')) return 'mp4';
29 30 else if (url.endsWith('.flv')) {
... ...
... ... @@ -21,12 +21,14 @@
21 21 import { VideoCancelModalParamsType } from '/@/views/device/list/cpns/tabs/VideoChannel/config';
22 22 const emit = defineEmits(['reloadTable', 'register']);
23 23
24   - const playUrl = ref();
25   - const options = ref<VideoCancelModalParamsType>();
  24 + const playUrl = ref<Nullable<string>>();
  25 + const options = ref<Nullable<VideoCancelModalParamsType>>();
26 26 const [register, { setModalProps }] = useModalInner(
27 27 async (data: ModalParamsType<VideoCancelModalParamsType>) => {
28 28 const { record } = data;
29 29 try {
  30 + playUrl.value = null;
  31 + options.value = null;
30 32 setModalProps({ loading: true, loadingTip: '视频加载中...' });
31 33 const { url, type } = await record.getPlayUrl();
32 34
... ...