+ + {{ item.cameraName || item.cameraIndexCode }} +
+{{ item.cameraName || item.cameraIndexCode }}
-
聚焦
@@ -50,16 +44,16 @@
import { ElMessage } from 'element-plus'
import { postVideoControlApi } from '@/api/monitor'
- import { mode, baseUrl, proBaseUrl } from '@/utils/config'
const Z00M_IN = 'ZOOM_IN' // 焦距变大
const Z00M_OUT = 'ZOOM_OUT' // 焦距变小
- const ACTION = '0'
const UP = 'UP' // 上转
const DOWN = 'DOWN' // 下转
const LEFT = 'LEFT' // 左转
const RIGHT = 'RIGHT' // 右转
const STOP = 'STOP' // 停止操作
+ let ACTION = '0'
+ let command = ref('')
const props = defineProps({
src: {
@@ -96,26 +90,27 @@
ACTION = '1'
} else {
ACTION = '0'
+ command.value = e
}
await postVideoControlApi({
- command: e,
+ command: command.value,
action: ACTION,
cameraIndexCode: props.cameraIndexCode
})
+ if (e == STOP) {
+ command.value = ''
+ }
ElMessage({
message: '操作成功',
type: 'success'
})
}
const handleClose = () => {
- // webRtcServer.disconnect()
hlsRef.destroy()
hlsRef = null
modelValue.value = false
}
const init = () => {
- // webRtcServer = new WebRtcStreamer('bigVideo', `${mode == 'dev' ? baseUrl : proBaseUrl}/webrtc`)
- // webRtcServer.connect(props.src)
hlsRef = new Hls({
enableWorker: false, // 禁用 Worker 来避免额外的线程
enableSoftwareAES: true, // 使用软件解码器以避免硬件解码的额外请求
diff --git a/src/views/monitor/components/box-2.vue b/src/views/monitor/components/box-2.vue
index f5e9f14..202594c 100644
--- a/src/views/monitor/components/box-2.vue
+++ b/src/views/monitor/components/box-2.vue
@@ -50,7 +50,7 @@
class="video-item"
v-for="(item, index) in videoList"
:key="index"
- @click="handleItemVideo(item.hlsUrl, 100)"
+ @click="handleItemVideo(item.hlsUrl, 100, item.cameraIndexCode)"
>
{{ item.cameraName || item.cameraIndexCode }} @@ -84,8 +84,9 @@
@@ -144,18 +157,29 @@