vani-meeting-server 1.4.4 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -106,15 +106,24 @@ class SFUEachRoomHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
|
|
|
106
106
|
this.addAudioObserver();
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
if (this.sendRouter) {
|
|
110
|
+
if (workers.length === 1) {
|
|
111
|
+
this.recvRouter.push(this.sendRouter);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
while (this.recvRouter.length < (workers.length - 1)) { // Dont create on send worker
|
|
115
|
+
const worker = workers[currentWorkerIndexForRouter];
|
|
116
|
+
currentWorkerIndexForRouter = this.getWorkerIndexForCreatingRouter(currentWorkerIndexForRouter, workers.length);
|
|
117
|
+
if (worker.pid === sendWorkerPID) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
this.recvRouter.push(await worker.createRouter({ mediaCodecs: Constant_1.mediaCodecs }));
|
|
121
|
+
console.log("rec router crearted");
|
|
122
|
+
}
|
|
115
123
|
}
|
|
116
|
-
|
|
117
|
-
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
console.error("no send router found while creating recv router");
|
|
118
127
|
}
|
|
119
128
|
this.workers = undefined;
|
|
120
129
|
this.sendWorkerIndex = -1;
|
|
@@ -175,8 +184,13 @@ class SFUEachRoomHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
|
|
|
175
184
|
return this.sendRouter;
|
|
176
185
|
}
|
|
177
186
|
async pipeToRoute(producer) {
|
|
178
|
-
if (!this.sendRouter) {
|
|
179
|
-
console.error("pipeToRoute - no send router found");
|
|
187
|
+
if (!this.sendRouter || this.recvRouter.length < 1) {
|
|
188
|
+
console.error("pipeToRoute - no send or recv router found");
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (this.recvRouter.length === 1 && this.sendRouter === this.recvRouter[0]) {
|
|
192
|
+
console.log("pipeToRoute - recvRouter and send router are same");
|
|
193
|
+
return;
|
|
180
194
|
}
|
|
181
195
|
for (const eachRecvRouter of this.recvRouter) {
|
|
182
196
|
try {
|
|
@@ -187,6 +187,12 @@ class EachSocketConnectionHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
|
|
|
187
187
|
else if (paylod.type === WebSocketBasicEvents.OnAudioVideoPauseResume) {
|
|
188
188
|
this.onAudioVideoPauseResume(paylod.data);
|
|
189
189
|
}
|
|
190
|
+
else if (paylod.type === WebSocketBasicEvents.UpdateParticipant) {
|
|
191
|
+
console.log("OnParticipantUpdated", paylod.data);
|
|
192
|
+
this.selfParticipant = paylod.data;
|
|
193
|
+
RedisHandler_1.RedisHandler.getInstance().addUpdateParticipantForRoom(this.selfParticipant.roomId, this.selfParticipant);
|
|
194
|
+
this.redisBroadcastMessageToTopic(this.selfParticipant.roomId, this.preapreClientMessageBody(false, this.selfParticipant, this.preapreWebSocketMessageBody(WebSocketBasicEvents.OnParticipantUpdated, this.selfParticipant)));
|
|
195
|
+
}
|
|
190
196
|
else if (paylod.type === SFUMessageType.SFUMessage) {
|
|
191
197
|
const roomSFUHandler = SFUHandler_1.SFUHandler.getInstance().getRoomSFUHandler(this.selfParticipant?.roomId);
|
|
192
198
|
if (roomSFUHandler) {
|