Commit b5ecc78c79382f5513c043068a8f13861c81d9d7
Committed by
xp.Huang
1 parent
2bfdeb18
fix:修复分屏模式下国标视频没有请求接口
Showing
2 changed files
with
33 additions
and
7 deletions
| ... | ... | @@ -20,6 +20,7 @@ |
| 20 | 20 | import { isRtspProtocol } from '/@/components/Video/src/utils'; |
| 21 | 21 | import { useFingerprint } from '/@/utils/useFingerprint'; |
| 22 | 22 | import { GetResult } from '@fingerprintjs/fingerprintjs'; |
| 23 | + import { getVideoControlStart } from '/@/api/device/videoChannel'; | |
| 23 | 24 | |
| 24 | 25 | const props = defineProps({ |
| 25 | 26 | mode: { |
| ... | ... | @@ -76,13 +77,6 @@ |
| 76 | 77 | |
| 77 | 78 | const result = await getResult(); |
| 78 | 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 | 80 | if (items.length < pagination.pageSize) { |
| 87 | 81 | const fillArr: any = Array.from({ length: pagination.pageSize - items.length }).map(() => ({ |
| 88 | 82 | id: buildUUID(), |
| ... | ... | @@ -91,6 +85,14 @@ |
| 91 | 85 | items = [...items, ...fillArr]; |
| 92 | 86 | } |
| 93 | 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 | 96 | } catch (error) { |
| 95 | 97 | } finally { |
| 96 | 98 | loading.value = false; |
| ... | ... | @@ -122,6 +124,24 @@ |
| 122 | 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 | 145 | if (record.accessMode === AccessMode.Streaming) { |
| 126 | 146 | try { |
| 127 | 147 | const { data: { url } = { url: '' } } = await getStreamingPlayUrl(record.id!); | ... | ... |