vani-meeting-server 1.5.8 → 1.6.0

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.
@@ -1,4 +1,5 @@
1
1
  import { PlainTransportCreatedCallback } from "../ServerHandler";
2
+ import { WebSocketMessageBody } from "../websocket/EachSocketConnectionHandler";
2
3
  import { Logs } from "./Logs";
3
4
  import { Participant } from "./Participant";
4
5
  export declare enum VaniEvent {
@@ -9,7 +10,8 @@ export declare enum VaniEvent {
9
10
  OnServerStarted = "onServerStarted",
10
11
  OnPlainTransportCreated = "onPlainTransportCreated",
11
12
  OnPlainTransportCreateError = "onPlainTransportCreateError",
12
- OnLog = "OnLog"
13
+ OnLog = "OnLog",
14
+ OnNewChatMessageReceived = "OnNewChatMessageReceived"
13
15
  }
14
16
  interface VaniConnectionEvents {
15
17
  [VaniEvent.OnNewMeetingStarted]: (roomId: string) => any;
@@ -20,6 +22,7 @@ interface VaniConnectionEvents {
20
22
  [VaniEvent.OnPlainTransportCreated]: (plainTransportCreatedCallback: PlainTransportCreatedCallback) => any;
21
23
  [VaniEvent.OnPlainTransportCreateError]: (plainTransportCreatedCallback: PlainTransportCreatedCallback) => any;
22
24
  [VaniEvent.OnLog]: (log: Logs) => any;
25
+ [VaniEvent.OnNewChatMessageReceived]: (payload: WebSocketMessageBody) => any;
23
26
  }
24
27
  export declare interface VaniEventListener {
25
28
  on<U extends keyof VaniConnectionEvents>(event: U, listener: VaniConnectionEvents[U]): this;
@@ -11,4 +11,5 @@ var VaniEvent;
11
11
  VaniEvent["OnPlainTransportCreated"] = "onPlainTransportCreated";
12
12
  VaniEvent["OnPlainTransportCreateError"] = "onPlainTransportCreateError";
13
13
  VaniEvent["OnLog"] = "OnLog";
14
+ VaniEvent["OnNewChatMessageReceived"] = "OnNewChatMessageReceived";
14
15
  })(VaniEvent = exports.VaniEvent || (exports.VaniEvent = {}));
@@ -163,6 +163,7 @@ class EachSocketConnectionHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
163
163
  this.onUserLeft();
164
164
  }
165
165
  else if (paylod.type === WebSocketBasicEvents.Pong) {
166
+ console.log(paylod, this.numberOfPongWaiting);
166
167
  this.numberOfPongWaiting = 0;
167
168
  }
168
169
  else if (paylod.type === WebSocketBasicEvents.GetMeetingStartTime) {
@@ -208,6 +209,7 @@ class EachSocketConnectionHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
208
209
  if (paylod.type !== WebSocketBasicEvents.Pong && paylod.type !== SFUMessageType.SFUMessage) {
209
210
  Utility_1.Utility.checkAndSendLogs({ logLevel: WebSocketServerStartRequest_1.LogLevel.Info, roomId: this.selfParticipant?.roomId, payload: paylod, logType: Logs_1.LogType.LogTypeWSS });
210
211
  }
212
+ this.sendVaniEvent(Event_1.VaniEvent.OnNewChatMessageReceived, paylod);
211
213
  }
212
214
  async onAudioVideoPauseResume(data) {
213
215
  if (this.selfParticipant) {
@@ -330,6 +332,7 @@ class EachSocketConnectionHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
330
332
  }
331
333
  this.redisBroadcastMessageToTopic(this.selfParticipant.userId, this.preapreClientMessageBody(true, this.selfParticipant, this.preapreWebSocketMessageBody(WebSocketBasicEvents.Ping, { userId: this.selfParticipant.userId })));
332
334
  this.numberOfPongWaiting = this.numberOfPongWaiting + 1;
335
+ console.log("Pong", this.numberOfPongWaiting);
333
336
  setTimeout(this.startPingPong, 5000);
334
337
  }
335
338
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-server",
3
- "version": "1.5.8",
3
+ "version": "1.6.0",
4
4
  "description": "Vani Meeting Server SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",