vani-meeting-server 1.4.3 → 1.4.5
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,14 +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
|
-
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
console.error("no send router found while creating recv router");
|
|
117
127
|
}
|
|
118
128
|
this.workers = undefined;
|
|
119
129
|
this.sendWorkerIndex = -1;
|
|
@@ -174,8 +184,13 @@ class SFUEachRoomHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
|
|
|
174
184
|
return this.sendRouter;
|
|
175
185
|
}
|
|
176
186
|
async pipeToRoute(producer) {
|
|
177
|
-
if (!this.sendRouter) {
|
|
178
|
-
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;
|
|
179
194
|
}
|
|
180
195
|
for (const eachRecvRouter of this.recvRouter) {
|
|
181
196
|
try {
|