Browse Source

延续状态,强制开MIC

gemercheung 3 years ago
parent
commit
d7163140d6
2 changed files with 7 additions and 0 deletions
  1. 6 0
      src/controller/room/assistant.js
  2. 1 0
      src/enum/event.js

+ 6 - 0
src/controller/room/assistant.js

@@ -302,6 +302,12 @@ export class RoomAssistant {
                   voiceStatus: Number(duplicateUser.voiceStatus),
                 });
                 console.log("在房间内延续部分数据", user);
+                if (Number(duplicateUser.isAllowMic) === 1) {
+                  console.log("在房间内延续强制开MIC voiceStatus", Number(duplicateUser.voiceStatus));
+                  this.socket.broadcast.to(this.room.syncId).emit(EVENT.serverOnMic, {
+                    voiceStatus: Number(duplicateUser.voiceStatus),
+                  });
+                }
               }
             });
             const res = await Promise.all(removeAll);

+ 1 - 0
src/enum/event.js

@@ -23,6 +23,7 @@ const EVENT = {
   beHasMic: "beHasMic", // 通知拥有MIC权
   silentUpdateRoom: "silentUpdateRoom", // 默认通知房间更新
   roomMaximum: "roomMaximum",
+  serverOnMic: "serverOnMic", //由服务器加MIC通知延续状态
 };
 
 export { EVENT };