wkw 1 month ago
parent
commit
e27f48979f

+ 7 - 0
src/stores/modules/webrtcStore.js

@@ -283,6 +283,13 @@ export const useWebRTCStore = defineStore("webrtc", {
 
       this.iceCandidates = [];
       this.connectionState = "disconnected";
+
+      this.isCaller = false;
+      this.imSate = {
+        videoCallModal: false, // 视频通话模态框
+        callName: "", // 通话对象名称
+        fromUserUuid: "", // 通话对象 uuid
+      }
     },
 
     // 获取视频流

+ 9 - 0
src/views/im/components/CallController/index.vue

@@ -271,6 +271,15 @@ function assignStreamsToVideo() {
   if (mainVideo.value) mainVideo.value.srcObject = mainStream.value;
   if (pipVideo.value) pipVideo.value.srcObject = pipStream.value;
 }
+
+watch(
+  () => rtcStore.isCaller,
+  (val) => {
+    console.log("isCaller", val);
+  },
+  { immediate: true }
+);
+
 // 监听远程流
 watch(
   () => rtcStore.connectionState,

+ 1 - 0
src/views/im/hook/messagesHook.js

@@ -15,6 +15,7 @@ const formatMessageExt = (message, ext) => {
       ...message,
       content:ext.content,
       msgId: ext.msgId,
+      fromUuid: ext.fromUuid,
       cc : ext.cc, // @群成员  0:全部
       id : ext.id, // 真实消息id
       quote : ext.quote, //引用的消息id