...
|
...
|
@@ -16,6 +16,7 @@ |
16
|
16
|
ZoomInOutlined,
|
17
|
17
|
ZoomOutOutlined,
|
18
|
18
|
} from '@ant-design/icons-vue';
|
|
19
|
+ // import { defHttp } from '/@/utils/http/axios';
|
19
|
20
|
import { Button } from 'ant-design-vue';
|
20
|
21
|
import { nextTick } from 'vue';
|
21
|
22
|
const { prefixCls } = useDesign('basic-video-play');
|
...
|
...
|
@@ -86,8 +87,12 @@ |
86
|
87
|
!unref(isPlay) && unref(videoPlayInstance)?.play();
|
87
|
88
|
};
|
88
|
89
|
|
89
|
|
- const handleTopClick = () => {
|
|
90
|
+ const handleTopClick = async () => {
|
90
|
91
|
console.log('上');
|
|
92
|
+ handleControl('up');
|
|
93
|
+ setTimeout(() => {
|
|
94
|
+ handleControl('stop');
|
|
95
|
+ }, 500);
|
91
|
96
|
};
|
92
|
97
|
|
93
|
98
|
const handleRightClick = () => {
|
...
|
...
|
@@ -107,6 +112,25 @@ |
107
|
112
|
console.log(type);
|
108
|
113
|
};
|
109
|
114
|
|
|
115
|
+ const handleControl = (direction: string) => {
|
|
116
|
+ const url = '/ptz/control/62020000492000000002/34020000001320000001';
|
|
117
|
+ const value = {
|
|
118
|
+ command: direction,
|
|
119
|
+ horizonSpeed: 30,
|
|
120
|
+ verticalSpeed: 30,
|
|
121
|
+ zoomSpeed: 30,
|
|
122
|
+ };
|
|
123
|
+ return defHttp.post(
|
|
124
|
+ {
|
|
125
|
+ url,
|
|
126
|
+ params: value,
|
|
127
|
+ },
|
|
128
|
+ {
|
|
129
|
+ joinPrefix: false,
|
|
130
|
+ }
|
|
131
|
+ );
|
|
132
|
+ };
|
|
133
|
+
|
110
|
134
|
const isPlay = ref<Boolean | null | undefined>(true);
|
111
|
135
|
|
112
|
136
|
onMounted(async () => {
|
...
|
...
|
@@ -148,6 +172,12 @@ |
148
|
172
|
reloadPlayer: init,
|
149
|
173
|
getInstance: () => unref(videoPlayInstance),
|
150
|
174
|
});
|
|
175
|
+
|
|
176
|
+ // const {send,close} = useWebSocket('ws://192.168.10.134:28080/rtp/62020000492000000002_34020000001320000001.live.flv',{
|
|
177
|
+ // async onConnected(){
|
|
178
|
+
|
|
179
|
+ // }
|
|
180
|
+ // })
|
151
|
181
|
</script>
|
152
|
182
|
|
153
|
183
|
<template>
|
...
|
...
|
|