vani-meeting-server 1.6.0 → 1.6.1

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.
@@ -320,8 +320,8 @@ class EachSocketConnectionHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
320
320
  });
321
321
  this.redisBroadcastMessageToTopic(this.selfParticipant.userId, this.preapreClientMessageBody(true, this.selfParticipant, this.preapreWebSocketMessageBody(WebSocketBasicEvents.OnServerParticipants, userMap)));
322
322
  }
323
- startPingPong() {
324
- if (this.isUserJoinedFromAnotherSocket === false && this.selfParticipant) {
323
+ async startPingPong() {
324
+ if (this.isUserJoinedFromAnotherSocket === false && this.selfParticipant && this.selfParticipant.roomId && this.selfParticipant.userId) {
325
325
  if (this.numberOfPongWaiting > 8) {
326
326
  console.log("No Pong More Than 8 Times start");
327
327
  console.log(this.selfParticipant);
@@ -330,10 +330,13 @@ class EachSocketConnectionHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
330
330
  this.onUserLeft();
331
331
  return;
332
332
  }
333
- this.redisBroadcastMessageToTopic(this.selfParticipant.userId, this.preapreClientMessageBody(true, this.selfParticipant, this.preapreWebSocketMessageBody(WebSocketBasicEvents.Ping, { userId: this.selfParticipant.userId })));
334
- this.numberOfPongWaiting = this.numberOfPongWaiting + 1;
335
- console.log("Pong", this.numberOfPongWaiting);
336
- setTimeout(this.startPingPong, 5000);
333
+ const user = await RedisHandler_1.RedisHandler.getInstance().getParticipantByUserId(this.selfParticipant.roomId, this.selfParticipant.userId);
334
+ if (user) {
335
+ this.redisBroadcastMessageToTopic(this.selfParticipant.userId, this.preapreClientMessageBody(true, this.selfParticipant, this.preapreWebSocketMessageBody(WebSocketBasicEvents.Ping, { userId: this.selfParticipant.userId })));
336
+ this.numberOfPongWaiting = this.numberOfPongWaiting + 1;
337
+ console.log("Pong", this.numberOfPongWaiting);
338
+ setTimeout(this.startPingPong, 5000);
339
+ }
337
340
  }
338
341
  }
339
342
  cleanUp() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-server",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Vani Meeting Server SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",