|
@@ -1,7 +1,7 @@
|
|
import { useWebRTCStore } from "@/stores/modules/webrtcStore";
|
|
import { useWebRTCStore } from "@/stores/modules/webrtcStore";
|
|
import { MSG_TYPE, MSG_TYPE_MAP } from "@/common/constant/msgType";
|
|
import { MSG_TYPE, MSG_TYPE_MAP } from "@/common/constant/msgType";
|
|
import * as Constant from "@/common/constant/Constant";
|
|
import * as Constant from "@/common/constant/Constant";
|
|
-import { setupNotifications } from "@/utils/notifications.js";
|
|
|
|
|
|
+import { setupNotifications, soundVoice } from "@/utils/notifications.js";
|
|
|
|
|
|
// 发送消息处理
|
|
// 发送消息处理
|
|
export const setMessageHook = (message, state) => {
|
|
export const setMessageHook = (message, state) => {
|
|
@@ -91,6 +91,7 @@ export const handleMessageHook = (message, state) => {
|
|
fromUserUuid: message.from,
|
|
fromUserUuid: message.from,
|
|
callAvatar: message.avatar
|
|
callAvatar: message.avatar
|
|
};
|
|
};
|
|
|
|
+ soundVoice.play()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
// 音频在线:取消
|
|
// 音频在线:取消
|
|
@@ -101,6 +102,7 @@ export const handleMessageHook = (message, state) => {
|
|
console.log("音频在线:取消")
|
|
console.log("音频在线:取消")
|
|
const rtcStore = useWebRTCStore();
|
|
const rtcStore = useWebRTCStore();
|
|
rtcStore.imSate.videoCallModal = false;
|
|
rtcStore.imSate.videoCallModal = false;
|
|
|
|
+ soundVoice.stop()
|
|
rtcStore.cleanup()
|
|
rtcStore.cleanup()
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -110,8 +112,10 @@ export const handleMessageHook = (message, state) => {
|
|
message.contentType === Constant.REJECT_VIDEO_ONLINE
|
|
message.contentType === Constant.REJECT_VIDEO_ONLINE
|
|
) {
|
|
) {
|
|
console.log("音频在线:拒接")
|
|
console.log("音频在线:拒接")
|
|
|
|
+ soundVoice.stop()
|
|
const rtcStore = useWebRTCStore();
|
|
const rtcStore = useWebRTCStore();
|
|
rtcStore.imSate.videoCallModal = false;
|
|
rtcStore.imSate.videoCallModal = false;
|
|
|
|
+
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
// 音频在线:接听
|
|
// 音频在线:接听
|
|
@@ -120,6 +124,7 @@ export const handleMessageHook = (message, state) => {
|
|
message.contentType === Constant.ACCEPT_AUDIO_ONLINE
|
|
message.contentType === Constant.ACCEPT_AUDIO_ONLINE
|
|
) {
|
|
) {
|
|
console.log("音频在线:接听", message.contentType)
|
|
console.log("音频在线:接听", message.contentType)
|
|
|
|
+ soundVoice.stop()
|
|
const video = message.contentType == Constant.ACCEPT_AUDIO_ONLINE
|
|
const video = message.contentType == Constant.ACCEPT_AUDIO_ONLINE
|
|
startAudioOnline(video, state);
|
|
startAudioOnline(video, state);
|
|
return;
|
|
return;
|
|
@@ -135,6 +140,7 @@ export const handleMessageHook = (message, state) => {
|
|
// dealMediaCall(message);
|
|
// dealMediaCall(message);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ soundVoice.stop()
|
|
const rtcStore = useWebRTCStore();
|
|
const rtcStore = useWebRTCStore();
|
|
const { type, sdp, iceCandidate } = JSON.parse(message.content);
|
|
const { type, sdp, iceCandidate } = JSON.parse(message.content);
|
|
// 接收answer:设置对端sdp
|
|
// 接收answer:设置对端sdp
|