...
|
...
|
@@ -61,6 +61,7 @@ import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/Ch |
61
|
61
|
import { NTreeSelect } from 'naive-ui'
|
62
|
62
|
import { getOrganizationList, getVideoList, getVideoUrl } from '@/api/external/common/index'
|
63
|
63
|
import { TKUpload } from '@/components/external/Common/TKUpload'
|
|
64
|
+import { getVideoControlStart } from '@/api/external/flvPlay'
|
64
|
65
|
|
65
|
66
|
const props = defineProps({
|
66
|
67
|
optionData: {
|
...
|
...
|
@@ -100,14 +101,14 @@ const getVideoLists = async (organizationId: string) => { |
100
|
101
|
const res = await getVideoList({ organizationId })
|
101
|
102
|
if (!res) return
|
102
|
103
|
videoOptions.value = res?.data?.map((item: videoListInterface) => {
|
103
|
|
- if(item.accessMode === AccessMode.GBT28181) return 0;
|
104
|
104
|
return {
|
105
|
105
|
label: item.name,
|
106
|
|
- value: item.accessMode === AccessMode.Streaming ? item.id : item.videoUrl,
|
|
106
|
+ value: item.accessMode === AccessMode.Streaming ? item.id : item.accessMode === AccessMode.ManuallyEnter ? item.videoUrl : item?.params?.deviceId,
|
107
|
107
|
id: item.id,
|
108
|
|
- accessMode: item.accessMode
|
109
|
|
- }
|
110
|
|
- }).filter(Boolean)
|
|
108
|
+ accessMode: item.accessMode,
|
|
109
|
+ channelId: item.accessMode === AccessMode.GBT28181 ? item?.params?.channelNo :''
|
|
110
|
+ }
|
|
111
|
+ })
|
111
|
112
|
}
|
112
|
113
|
|
113
|
114
|
const getVideoUrlById = async (id: string) => {
|
...
|
...
|
@@ -126,19 +127,27 @@ const handleChecked = (value: string) => { |
126
|
127
|
}
|
127
|
128
|
}
|
128
|
129
|
|
129
|
|
-const handleSelect = (_: string, e: videoListInterface) => {
|
130
|
|
- const { accessMode, id, value } = e
|
131
|
|
- //1表示,需要从服务端调取接口换取播放的地址,0则不需要
|
|
130
|
+const handleSelect = async (_: string, e: videoListInterface) => {
|
|
131
|
+ const { accessMode, id, value , channelId } = e
|
|
132
|
+ //流媒体,需要从服务端调取接口换取播放的地址
|
132
|
133
|
if (accessMode === AccessMode.Streaming) {
|
133
|
134
|
getVideoUrlById(id)
|
134
|
135
|
url.value = id
|
135
|
136
|
props.optionData.videoId = id
|
|
137
|
+ } else if (accessMode === AccessMode.GBT28181) {
|
|
138
|
+ //gbt28181,需要调用接口获取flv播放地址
|
|
139
|
+ if(!value) return
|
|
140
|
+ const { data: { flv } } = await getVideoControlStart({
|
|
141
|
+ deviceId: value,
|
|
142
|
+ channelId
|
|
143
|
+ })
|
|
144
|
+ props.optionData.dataset = flv || ''
|
136
|
145
|
} else {
|
137
|
146
|
props.optionData.dataset = value as string
|
138
|
147
|
}
|
139
|
148
|
}
|
140
|
149
|
|
141
|
|
-onMounted(async() => {
|
|
150
|
+onMounted(async () => {
|
142
|
151
|
if (props.optionData.sourceType === sourceTypeEnum.PLATFORM) {
|
143
|
152
|
getOriginationList()
|
144
|
153
|
if (props.optionData.organization) {
|
...
|
...
|
|