|
@@ -2,8 +2,8 @@
|
|
|
<div class="room">
|
|
<div class="room">
|
|
|
<topBar class="room-bar">
|
|
<topBar class="room-bar">
|
|
|
<signal :signal-value="signalValue" />
|
|
<signal :signal-value="signalValue" />
|
|
|
- <audiod :state="audioValue" />
|
|
|
|
|
<battery :quantity="batteryValue" />
|
|
<battery :quantity="batteryValue" />
|
|
|
|
|
+ <mic @callBack="sendAudio" />
|
|
|
</topBar>
|
|
</topBar>
|
|
|
<video
|
|
<video
|
|
|
ref="remoteVideo"
|
|
ref="remoteVideo"
|
|
@@ -27,7 +27,7 @@ import topBar from '@/components/topBar.vue'
|
|
|
import signal from '@/components/signal.vue'
|
|
import signal from '@/components/signal.vue'
|
|
|
import battery from '@/components/battery.vue'
|
|
import battery from '@/components/battery.vue'
|
|
|
import gauge from '@/components/gauge.vue'
|
|
import gauge from '@/components/gauge.vue'
|
|
|
-import audiod from '@/components/audio.vue'
|
|
|
|
|
|
|
+import mic from '@/components/mic.vue'
|
|
|
import WebRtcService from '@/services/webrtc.service'
|
|
import WebRtcService from '@/services/webrtc.service'
|
|
|
import useStore from '@/store/index'
|
|
import useStore from '@/store/index'
|
|
|
|
|
|
|
@@ -35,12 +35,19 @@ const signalValue = ref(5)
|
|
|
const batteryValue = ref(50)
|
|
const batteryValue = ref(50)
|
|
|
const SpeedValue = ref(60)
|
|
const SpeedValue = ref(60)
|
|
|
const conctrlNum = ref(0)
|
|
const conctrlNum = ref(0)
|
|
|
-const audioValue = ref(3)
|
|
|
|
|
const remoteVideo = ref(null as unknown as HTMLVideoElement)
|
|
const remoteVideo = ref(null as unknown as HTMLVideoElement)
|
|
|
const RTC = new WebRtcService()
|
|
const RTC = new WebRtcService()
|
|
|
const store = useStore()
|
|
const store = useStore()
|
|
|
const mqtt = inject('MQTT') as Any
|
|
const mqtt = inject('MQTT') as Any
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 发送语音
|
|
|
|
|
+ * @param blob blob
|
|
|
|
|
+ */
|
|
|
|
|
+function sendAudio(blob:Blob) {
|
|
|
|
|
+ console.log('send audio', blob)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
onMounted(() => RTC.initRTC(remoteVideo.value, (event) => {
|
|
onMounted(() => RTC.initRTC(remoteVideo.value, (event) => {
|
|
|
const { type, data } = event
|
|
const { type, data } = event
|
|
|
if (type === 'connected') {
|
|
if (type === 'connected') {
|
|
@@ -79,7 +86,7 @@ watch(() => store.mqtt_message, async (val: { type: string, data?: RTCSessionDes
|
|
|
align-items: flex-end;
|
|
align-items: flex-end;
|
|
|
|
|
|
|
|
&>* {
|
|
&>* {
|
|
|
- margin: 0 5px 0 10px;
|
|
|
|
|
|
|
+ margin: 0 0 0 10px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|