...
|
...
|
@@ -13,20 +13,14 @@ |
13
|
13
|
} from '@ant-design/icons-vue';
|
14
|
14
|
import { Button, Slider } from 'ant-design-vue';
|
15
|
15
|
import { controlling } from '/@/api/camera/cameraManager';
|
16
|
|
- import { setVideoControl } from '/@/api/device/videoChannel';
|
|
16
|
+ import { setEzvizControl, setVideoControl } from '/@/api/device/videoChannel';
|
17
|
17
|
import XGPlayer from '/@/components/Video/src/XGPlayer.vue';
|
18
|
|
- import PresetPlayer from 'xgplayer';
|
|
18
|
+ import { EzvizVideoControlEnum, VideoCancelModalParamsType, VideoControlEnum } from './config';
|
|
19
|
+ import { VideoPlatformEnum } from '/@/views/camera/manage/config.data';
|
19
|
20
|
|
20
|
21
|
const props = defineProps<{
|
21
|
22
|
playUrl?: string;
|
22
|
|
- options?: {
|
23
|
|
- canControl?: boolean;
|
24
|
|
- isGBT?: boolean;
|
25
|
|
- tbDeviceId?: string;
|
26
|
|
- channelId?: string;
|
27
|
|
- id?: string;
|
28
|
|
- playerProps?: Recordable;
|
29
|
|
- };
|
|
23
|
+ options?: VideoCancelModalParamsType;
|
30
|
24
|
}>();
|
31
|
25
|
|
32
|
26
|
const playerRef = ref<InstanceType<typeof XGPlayer>>();
|
...
|
...
|
@@ -64,12 +58,24 @@ |
64
|
58
|
});
|
65
|
59
|
};
|
66
|
60
|
|
|
61
|
+ const handleEzvizControl = (actionType: string, start: boolean) => {
|
|
62
|
+ const { id } = props.options || {};
|
|
63
|
+ const action = EzvizVideoControlEnum[actionType as VideoControlEnum];
|
|
64
|
+ setEzvizControl({ entityId: id!, action, controllingType: Number(!start) });
|
|
65
|
+ };
|
|
66
|
+
|
67
|
67
|
//长按开始
|
68
|
68
|
const moveStart = (action: string) => {
|
69
|
69
|
if (unref(props.options?.isGBT)) {
|
70
|
70
|
handleGBTControl(action, unref(sliderValue));
|
71
|
71
|
return;
|
72
|
72
|
}
|
|
73
|
+
|
|
74
|
+ if (props.options?.videoPlatformType === VideoPlatformEnum.FLUORITE) {
|
|
75
|
+ handleEzvizControl(action, true);
|
|
76
|
+ return;
|
|
77
|
+ }
|
|
78
|
+
|
73
|
79
|
handleControl(0, action);
|
74
|
80
|
};
|
75
|
81
|
|
...
|
...
|
@@ -79,6 +85,14 @@ |
79
|
85
|
handleGBTControl('STOP', unref(sliderValue));
|
80
|
86
|
return;
|
81
|
87
|
}
|
|
88
|
+
|
|
89
|
+ if (props.options?.videoPlatformType === VideoPlatformEnum.FLUORITE) {
|
|
90
|
+ setTimeout(() => {
|
|
91
|
+ handleEzvizControl(action, false);
|
|
92
|
+ }, 1000);
|
|
93
|
+ return;
|
|
94
|
+ }
|
|
95
|
+
|
82
|
96
|
handleControl(1, action);
|
83
|
97
|
};
|
84
|
98
|
|
...
|
...
|
@@ -122,15 +136,15 @@ |
122
|
136
|
<div>
|
123
|
137
|
<Button
|
124
|
138
|
class="left-top in-block"
|
125
|
|
- @mousedown="moveStart('UP')"
|
126
|
|
- @mouseup="moveStop('UP')"
|
|
139
|
+ @mousedown="moveStart(VideoControlEnum.Up)"
|
|
140
|
+ @mouseup="moveStop(VideoControlEnum.Up)"
|
127
|
141
|
>
|
128
|
142
|
<CaretUpOutlined class="icon-rotate child-icon" />
|
129
|
143
|
</Button>
|
130
|
144
|
<Button
|
131
|
145
|
class="right-top in-block"
|
132
|
|
- @mousedown="moveStart('RIGHT')"
|
133
|
|
- @mouseup="moveStop('RIGHT')"
|
|
146
|
+ @mousedown="moveStart(VideoControlEnum.Right)"
|
|
147
|
+ @mouseup="moveStop(VideoControlEnum.Right)"
|
134
|
148
|
>
|
135
|
149
|
<CaretRightOutlined class="icon-rotate child-icon" />
|
136
|
150
|
</Button>
|
...
|
...
|
@@ -138,15 +152,15 @@ |
138
|
152
|
<div>
|
139
|
153
|
<Button
|
140
|
154
|
class="left-bottom in-block"
|
141
|
|
- @mousedown="moveStart('LEFT')"
|
142
|
|
- @mouseup="moveStop('LEFT')"
|
|
155
|
+ @mousedown="moveStart(VideoControlEnum.Left)"
|
|
156
|
+ @mouseup="moveStop(VideoControlEnum.Left)"
|
143
|
157
|
>
|
144
|
158
|
<CaretLeftOutlined class="icon-rotate child-icon" />
|
145
|
159
|
</Button>
|
146
|
160
|
<Button
|
147
|
161
|
class="right-bottom in-block"
|
148
|
|
- @mousedown="moveStart('DOWN')"
|
149
|
|
- @mouseup="moveStop('DOWN')"
|
|
162
|
+ @mousedown="moveStart(VideoControlEnum.Down)"
|
|
163
|
+ @mouseup="moveStop(VideoControlEnum.Down)"
|
150
|
164
|
>
|
151
|
165
|
<CaretDownOutlined class="icon-rotate child-icon" />
|
152
|
166
|
</Button>
|
...
|
...
|
@@ -161,16 +175,16 @@ |
161
|
175
|
<div class="flex justify-center mt-8">
|
162
|
176
|
<Button
|
163
|
177
|
class="button-icon"
|
164
|
|
- @mousedown="moveStart('ZOOM_IN')"
|
165
|
|
- @mouseup="moveStop('ZOOM_IN')"
|
|
178
|
+ @mousedown="moveStart(VideoControlEnum.ZoomIn)"
|
|
179
|
+ @mouseup="moveStop(VideoControlEnum.ZoomIn)"
|
166
|
180
|
style="border-radius: 50%"
|
167
|
181
|
>
|
168
|
182
|
<ZoomInOutlined style="color: #315a9c; font-size: 1.5rem" />
|
169
|
183
|
</Button>
|
170
|
184
|
<Button
|
171
|
185
|
class="ml-10 button-icon"
|
172
|
|
- @mousedown="moveStart('ZOOM_OUT')"
|
173
|
|
- @mouseup="moveStop('ZOOM_OUT')"
|
|
186
|
+ @mousedown="moveStart(VideoControlEnum.ZoomOut)"
|
|
187
|
+ @mouseup="moveStop(VideoControlEnum.ZoomOut)"
|
174
|
188
|
style="border-radius: 50%"
|
175
|
189
|
>
|
176
|
190
|
<ZoomOutOutlined style="color: #315a9c; font-size: 1.5rem" />
|
...
|
...
|
|