Commit de7bb1b98bd60b8fd5540b95d5e0f4058655ee5e

Authored by xp.Huang
2 parents 8bc2e91e 42d4be97

Merge branch 'fix/DEFECT-1970' into 'main_dev'

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

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