Commit 574dad00fc42ef9c53564de7f022c95b779386d2

Authored by loveumiko
1 parent f4b46728

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

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