Commit 574dad00fc42ef9c53564de7f022c95b779386d2

Authored by loveumiko
1 parent f4b46728

fix: 流媒体播放退出当前页面调用退出播放接口

@@ -29,7 +29,12 @@ @@ -29,7 +29,12 @@
29 import type { StreamingManageRecord, CameraModel } from '/@/api/camera/model/cameraModel'; 29 import type { StreamingManageRecord, CameraModel } from '/@/api/camera/model/cameraModel';
30 import { BasicVideoPlay, getVideoTypeByUrl } from '/@/components/Video'; 30 import { BasicVideoPlay, getVideoTypeByUrl } from '/@/components/Video';
31 import { AccessMode } from './config.data'; 31 import { AccessMode } from './config.data';
32 - import { closeFlvPlay, getFlvPlayUrl, getStreamingPlayUrl } from '/@/api/camera/cameraManager'; 32 + import {
  33 + closeFlvPlay,
  34 + getFlvPlayUrl,
  35 + getStreamingPlayUrl,
  36 + outVideo,
  37 + } from '/@/api/camera/cameraManager';
33 import { isRtspProtocol } from '/@/components/Video/src/utils'; 38 import { isRtspProtocol } from '/@/components/Video/src/utils';
34 import { VideoJsPlayerOptions } from 'video.js'; 39 import { VideoJsPlayerOptions } from 'video.js';
35 import { useFingerprint } from '/@/utils/useFingerprint'; 40 import { useFingerprint } from '/@/utils/useFingerprint';
@@ -42,6 +47,8 @@ @@ -42,6 +47,8 @@
42 47
43 const withToken = ref(false); 48 const withToken = ref(false);
44 49
  50 + const videoId = ref<string>();
  51 +
45 const fingerprintResult = ref<Nullable<GetResult>>(null); 52 const fingerprintResult = ref<Nullable<GetResult>>(null);
46 53
47 const options = reactive<VideoJsPlayerOptions>({ 54 const options = reactive<VideoJsPlayerOptions>({
@@ -64,6 +71,7 @@ @@ -64,6 +71,7 @@
64 const [register] = useModalInner( 71 const [register] = useModalInner(
65 async (data: { record: CameraModel | StreamingManageRecord }) => { 72 async (data: { record: CameraModel | StreamingManageRecord }) => {
66 const { record } = data; 73 const { record } = data;
  74 + videoId.value = record.id || '';
67 const result = await getResult(); 75 const result = await getResult();
68 fingerprintResult.value = result; 76 fingerprintResult.value = result;
69 if (record.accessMode === AccessMode.ManuallyEnter) { 77 if (record.accessMode === AccessMode.ManuallyEnter) {
@@ -94,6 +102,7 @@ @@ -94,6 +102,7 @@
94 const handleCancel = () => { 102 const handleCancel = () => {
95 showVideo.value = false; 103 showVideo.value = false;
96 withToken.value = false; 104 withToken.value = false;
  105 + outVideo(videoId.value);
97 }; 106 };
98 </script> 107 </script>
99 108