Commit f4b46728232fc4ff55f65686d4af562c1ffcacbc

Authored by loveumiko
1 parent 0db2dbdf

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

@@ -19,6 +19,7 @@ enum CameraManagerApi { @@ -19,6 +19,7 @@ enum CameraManagerApi {
19 STREAMING_POST_URL = '/video/platform', 19 STREAMING_POST_URL = '/video/platform',
20 STREAMING_DELETE_URL = '/video/platform', 20 STREAMING_DELETE_URL = '/video/platform',
21 STREAMING_PLAY_GET_URL = '/video/url', 21 STREAMING_PLAY_GET_URL = '/video/url',
  22 + OUT_VIDEO = '/video/outVideo',
22 } 23 }
23 24
24 export const cameraPage = (params: CameraQueryParam) => { 25 export const cameraPage = (params: CameraQueryParam) => {
@@ -127,3 +128,13 @@ export const controlling = (params: any) => { @@ -127,3 +128,13 @@ export const controlling = (params: any) => {
127 params, 128 params,
128 }); 129 });
129 }; 130 };
  131 +
  132 +/**
  133 + * @description 退出视频流播放
  134 + * @param entityId
  135 + */
  136 +export const outVideo = (entityId) => {
  137 + return defHttp.get({
  138 + url: `${CameraManagerApi.OUT_VIDEO}/${entityId}`,
  139 + });
  140 +};
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 import { PageWrapper } from '/@/components/Page'; 2 import { PageWrapper } from '/@/components/Page';
3 import OrganizationIdTree from '../../common/organizationIdTree/src/OrganizationIdTree.vue'; 3 import OrganizationIdTree from '../../common/organizationIdTree/src/OrganizationIdTree.vue';
4 - import { onMounted, reactive, Ref, ref, unref, watch } from 'vue'; 4 + import { onMounted, onUnmounted, reactive, Ref, ref, unref, watch } from 'vue';
5 import { Spin, Button, Pagination, Space, List } from 'ant-design-vue'; 5 import { Spin, Button, Pagination, Space, List } from 'ant-design-vue';
6 import { cameraPage, closeFlvPlay, getFlvPlayUrl } from '/@/api/camera/cameraManager'; 6 import { cameraPage, closeFlvPlay, getFlvPlayUrl } from '/@/api/camera/cameraManager';
7 import { CameraRecord } from '/@/api/camera/model/cameraModel'; 7 import { CameraRecord } from '/@/api/camera/model/cameraModel';
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 import { useDrawer } from '/@/components/Drawer'; 10 import { useDrawer } from '/@/components/Drawer';
11 import { AccessMode, CameraPermission, PageMode } from './config.data'; 11 import { AccessMode, CameraPermission, PageMode } from './config.data';
12 import SvgIcon from '/@/components/Icon/src/SvgIcon.vue'; 12 import SvgIcon from '/@/components/Icon/src/SvgIcon.vue';
13 - import { getStreamingPlayUrl } from '/@/api/camera/cameraManager'; 13 + import { getStreamingPlayUrl, outVideo } from '/@/api/camera/cameraManager';
14 import { buildUUID } from '/@/utils/uuid'; 14 import { buildUUID } from '/@/utils/uuid';
15 import { BasicVideoPlay, getVideoTypeByUrl } from '/@/components/Video'; 15 import { BasicVideoPlay, getVideoTypeByUrl } from '/@/components/Video';
16 import { VideoJsPlayerOptions } from 'video.js'; 16 import { VideoJsPlayerOptions } from 'video.js';
@@ -195,6 +195,13 @@ @@ -195,6 +195,13 @@
195 onMounted(() => { 195 onMounted(() => {
196 getCameraList(); 196 getCameraList();
197 }); 197 });
  198 + onUnmounted(() => {
  199 + if (unref(cameraList).length) {
  200 + unref(cameraList).forEach((item) => {
  201 + outVideo(item.id);
  202 + });
  203 + }
  204 + });
198 205
199 const listEl = ref(); 206 const listEl = ref();
200 onMounted(() => { 207 onMounted(() => {