vani-meeting-server 1.5.7 → 1.5.8
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.
package/lib/ServerHandler.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RedisHandler } from "./lib/redis/RedisHandler";
|
|
2
|
+
import { Participant } from "./models/Participant";
|
|
2
3
|
import { WebSocketServerStartRequest } from "./models/WebSocketServerStartRequest";
|
|
3
4
|
import { SFUHandler } from "./sfu/SFUHandler";
|
|
4
5
|
import { WebSocketHandler } from "./websocket/WebSocketHandler";
|
|
@@ -28,4 +29,5 @@ export declare class ServerHandler {
|
|
|
28
29
|
startPlainTransportForBroadcasting(plainTransportPayload: PlainTransportPayload, forRoomid: string): Promise<void>;
|
|
29
30
|
resumePlainTransportForBroadcasting(forRoomid: string): Promise<void>;
|
|
30
31
|
getAllOnGoingMeetingRoomIds(): Promise<string[] | undefined>;
|
|
32
|
+
getAllParticipatnsForRoomId(roomId: string): Promise<Participant[]>;
|
|
31
33
|
}
|
package/lib/ServerHandler.js
CHANGED
|
@@ -38,5 +38,8 @@ class ServerHandler {
|
|
|
38
38
|
async getAllOnGoingMeetingRoomIds() {
|
|
39
39
|
return await this.rediHandler?.getAllRoomsId();
|
|
40
40
|
}
|
|
41
|
+
async getAllParticipatnsForRoomId(roomId) {
|
|
42
|
+
return await RedisHandler_1.RedisHandler.getInstance().getAllParticipants(roomId);
|
|
43
|
+
}
|
|
41
44
|
}
|
|
42
45
|
exports.ServerHandler = ServerHandler;
|
|
@@ -367,7 +367,11 @@ class SFUEachRoomUserHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
|
|
|
367
367
|
}
|
|
368
368
|
const dtlsParameters = payload.message.dtlsParameters;
|
|
369
369
|
if (transport) {
|
|
370
|
-
|
|
370
|
+
try {
|
|
371
|
+
await transport.connect({ dtlsParameters });
|
|
372
|
+
}
|
|
373
|
+
catch (err) {
|
|
374
|
+
}
|
|
371
375
|
this.redisBroadcastMessageToTopic(this.selfParticipant.userId, this.preapreClientMessageBody(true, this.selfParticipant, this.preapreWebSocketMessageBody(EachSocketConnectionHandler_1.SFUMessageType.OnTransportConnectDone, { transportId: transport.id })));
|
|
372
376
|
}
|
|
373
377
|
else {
|
|
@@ -90,6 +90,7 @@ export declare class EachSocketConnectionHandler extends BaseSFUWebsocket {
|
|
|
90
90
|
private selfParticipant?;
|
|
91
91
|
private appId;
|
|
92
92
|
private isActive;
|
|
93
|
+
private isUserJoinedFromAnotherSocket;
|
|
93
94
|
private roomIds;
|
|
94
95
|
private redisSubscribtionDetails;
|
|
95
96
|
private isReconnectionFromUrl;
|
|
@@ -88,6 +88,7 @@ class EachSocketConnectionHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
|
|
|
88
88
|
selfParticipant;
|
|
89
89
|
appId = 'Demo';
|
|
90
90
|
isActive = false;
|
|
91
|
+
isUserJoinedFromAnotherSocket = false;
|
|
91
92
|
roomIds = [];
|
|
92
93
|
redisSubscribtionDetails = [];
|
|
93
94
|
isReconnectionFromUrl = false;
|
|
@@ -318,11 +319,11 @@ class EachSocketConnectionHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
|
|
|
318
319
|
this.redisBroadcastMessageToTopic(this.selfParticipant.userId, this.preapreClientMessageBody(true, this.selfParticipant, this.preapreWebSocketMessageBody(WebSocketBasicEvents.OnServerParticipants, userMap)));
|
|
319
320
|
}
|
|
320
321
|
startPingPong() {
|
|
321
|
-
if (this.
|
|
322
|
-
if (this.numberOfPongWaiting >
|
|
323
|
-
console.log("No Pong More Than
|
|
322
|
+
if (this.isUserJoinedFromAnotherSocket === false && this.selfParticipant) {
|
|
323
|
+
if (this.numberOfPongWaiting > 8) {
|
|
324
|
+
console.log("No Pong More Than 8 Times start");
|
|
324
325
|
console.log(this.selfParticipant);
|
|
325
|
-
console.log("No Pong More Than
|
|
326
|
+
console.log("No Pong More Than 8 Times End");
|
|
326
327
|
// isUserLeftMsgSent = true;
|
|
327
328
|
this.onUserLeft();
|
|
328
329
|
return;
|
|
@@ -361,6 +362,7 @@ class EachSocketConnectionHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
|
|
|
361
362
|
const userId = data.userId;
|
|
362
363
|
if (userId === this.selfParticipant?.userId && this.uuid !== senderUUID && this.roomIds.includes(roomId)) {
|
|
363
364
|
this.isActive = false;
|
|
365
|
+
this.isUserJoinedFromAnotherSocket = true;
|
|
364
366
|
this.socket.close(3006);
|
|
365
367
|
this.cleanUp();
|
|
366
368
|
console.log("onNewUserJoinedRoomWithSameUserId done");
|