Commit b5ecc78c79382f5513c043068a8f13861c81d9d7

Authored by 张 峰林
Committed by xp.Huang
1 parent 2bfdeb18

fix:修复分屏模式下国标视频没有请求接口

@@ -100,4 +100,10 @@ export interface CameraRecord { @@ -100,4 +100,10 @@ export interface CameraRecord {
100 status: boolean; 100 status: boolean;
101 accessMode: number; 101 accessMode: number;
102 playProtocol: number; 102 playProtocol: number;
  103 + deviceId?: string;
  104 + channelId?: string;
  105 + params?: {
  106 + channelNo: string;
  107 + deviceId: string;
  108 + };
103 } 109 }
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
20 import { isRtspProtocol } from '/@/components/Video/src/utils'; 20 import { isRtspProtocol } from '/@/components/Video/src/utils';
21 import { useFingerprint } from '/@/utils/useFingerprint'; 21 import { useFingerprint } from '/@/utils/useFingerprint';
22 import { GetResult } from '@fingerprintjs/fingerprintjs'; 22 import { GetResult } from '@fingerprintjs/fingerprintjs';
  23 + import { getVideoControlStart } from '/@/api/device/videoChannel';
23 24
24 const props = defineProps({ 25 const props = defineProps({
25 mode: { 26 mode: {
@@ -76,13 +77,6 @@ @@ -76,13 +77,6 @@
76 77
77 const result = await getResult(); 78 const result = await getResult();
78 fingerprintResult.value = result; 79 fingerprintResult.value = result;
79 - for (const item of items) {  
80 - (item as CameraRecordItem).isTransform = false;  
81 - (item as CameraRecordItem).videoPlayerOptions = {  
82 - ...basicVideoPlayOptions,  
83 - };  
84 - beforeVideoPlay(item, result);  
85 - }  
86 if (items.length < pagination.pageSize) { 80 if (items.length < pagination.pageSize) {
87 const fillArr: any = Array.from({ length: pagination.pageSize - items.length }).map(() => ({ 81 const fillArr: any = Array.from({ length: pagination.pageSize - items.length }).map(() => ({
88 id: buildUUID(), 82 id: buildUUID(),
@@ -91,6 +85,14 @@ @@ -91,6 +85,14 @@
91 items = [...items, ...fillArr]; 85 items = [...items, ...fillArr];
92 } 86 }
93 cameraList.value = items; 87 cameraList.value = items;
  88 +
  89 + for (const item of unref(cameraList)) {
  90 + (item as CameraRecordItem).isTransform = false;
  91 + (item as CameraRecordItem).videoPlayerOptions = {
  92 + ...basicVideoPlayOptions,
  93 + };
  94 + beforeVideoPlay(item as CameraRecordItem, result);
  95 + }
94 } catch (error) { 96 } catch (error) {
95 } finally { 97 } finally {
96 loading.value = false; 98 loading.value = false;
@@ -122,6 +124,24 @@ @@ -122,6 +124,24 @@
122 record.isTransform = true; 124 record.isTransform = true;
123 } 125 }
124 } 126 }
  127 + if (record.accessMode === AccessMode.GBT28181) {
  128 + try {
  129 + const { params } = record;
  130 + if (params?.channelNo && params.deviceId) {
  131 + const result = await getVideoControlStart({
  132 + deviceId: params.deviceId,
  133 + channelId: params.channelNo,
  134 + });
  135 +
  136 + (record as CameraRecordItem).videoPlayerOptions = {
  137 + ...basicVideoPlayOptions,
  138 + sources: [{ src: result.data.flv, type: getVideoTypeByUrl(result.data.flv) }],
  139 + };
  140 + }
  141 + } finally {
  142 + record.isTransform = true;
  143 + }
  144 + }
125 if (record.accessMode === AccessMode.Streaming) { 145 if (record.accessMode === AccessMode.Streaming) {
126 try { 146 try {
127 const { data: { url } = { url: '' } } = await getStreamingPlayUrl(record.id!); 147 const { data: { url } = { url: '' } } = await getStreamingPlayUrl(record.id!);