|
|
@@ -38,26 +38,34 @@ import topBar from '@/components/topBar.vue'
|
|
|
import Gauge from '@/components/gauge.vue'
|
|
|
import useStore from '@/store/index'
|
|
|
|
|
|
-const remoteVideo = ref(null as unknown as HTMLVideoElement)
|
|
|
const RTC = new WebRtcService()
|
|
|
const store = useStore()
|
|
|
const mqtt = inject('MQTT') as Any
|
|
|
+const remoteVideo = ref(null as unknown as HTMLVideoElement)
|
|
|
+const gauge = ref({ speed: 0, num: 0 })
|
|
|
const menuList = shallowRef([
|
|
|
{ name: '信号', value: 0, component: defineAsyncComponent(() => import('@/components/signal.vue')) },
|
|
|
{ name: '电量', value: 0, component: defineAsyncComponent(() => import('@/components/battery.vue')) },
|
|
|
{
|
|
|
- name: '录音',
|
|
|
- value: 0,
|
|
|
- callBack: (blob: Blob) => {
|
|
|
- console.log('send audio', blob)
|
|
|
- },
|
|
|
- component: defineAsyncComponent(() => import('@/components/mic.vue'))
|
|
|
+ name: '方向盘',
|
|
|
+ component: defineAsyncComponent(() => import('@/components/steering.vue')),
|
|
|
+ callBack: () => {
|
|
|
+ console.log('方向盘')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '静音',
|
|
|
+ component: defineAsyncComponent(() => import('@/components/audio.vue')),
|
|
|
+ callBack: (mute: boolean) => RTC.muteRemoteAudio(mute)
|
|
|
},
|
|
|
{
|
|
|
- name: '静音', value: 0, callBack: (mute: boolean) => RTC.muteRemoteAudio(mute), component: defineAsyncComponent(() => import('@/components/audio.vue'))
|
|
|
+ name: '录音',
|
|
|
+ component: defineAsyncComponent(() => import('@/components/mic.vue')),
|
|
|
+ callBack: (blob: Blob) => {
|
|
|
+ console.log('发送对讲', blob)
|
|
|
+ }
|
|
|
}
|
|
|
])
|
|
|
-const gauge = ref({ speed: 0, num: 0 })
|
|
|
|
|
|
watch(() => store.mqtt_message, async (value: { type: string, data?: RTCSessionDescriptionInit }) => {
|
|
|
const { type, data } = value
|
|
|
@@ -82,17 +90,6 @@ onUnmounted(() => RTC.distory())
|
|
|
height: 100%;
|
|
|
position: relative;
|
|
|
|
|
|
- &-bar {
|
|
|
- :deep(.topBar-content) {
|
|
|
- display: flex;
|
|
|
- align-items: flex-end;
|
|
|
-
|
|
|
- &>* {
|
|
|
- margin: 0 0 0 10px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
video {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
@@ -101,17 +98,5 @@ onUnmounted(() => RTC.distory())
|
|
|
font-size: 0;
|
|
|
z-index: 1;
|
|
|
}
|
|
|
-
|
|
|
- &-gauge {
|
|
|
- width: 30vw;
|
|
|
- height: 15vw;
|
|
|
- max-width: 460px;
|
|
|
- max-height: 230px;
|
|
|
- position: absolute;
|
|
|
- bottom: 0;
|
|
|
- left: 50%;
|
|
|
- transform: translateX(-50%);
|
|
|
- z-index: 2;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|