vani-meeting-client 1.8.0 → 1.8.2

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.
@@ -172,10 +172,10 @@ var CommunicationHandler = /** @class */ (function () {
172
172
  userIds = userIds + " " + userId;
173
173
  _this.addParticipantIfNotExist(participant, false);
174
174
  });
175
- var allParticiapntsToBeRemove = this.allParticipants.filter(function (participant) { return (userIds.includes(participant.userId) === false); });
176
- allParticiapntsToBeRemove.forEach(function (participant) {
177
- _this.removeParticipant(participant, true);
178
- });
175
+ // const allParticiapntsToBeRemove = this.allParticipants.filter(participant => (userIds.includes(participant.userId) === false))
176
+ // allParticiapntsToBeRemove.forEach(participant => {
177
+ // this.removeParticipant(participant, true);
178
+ // })
179
179
  this.emitMessageToSource(VaniEvent.OnAllParticipants, this.allParticipants);
180
180
  }
181
181
  };
@@ -32,7 +32,8 @@ export declare enum VaniEvent {
32
32
  OnNotReachable = "notReachable",
33
33
  OnReconectionTimeout = "reconectionTimeout",
34
34
  OnReconecting = "reconecting",
35
- OnUserOnFoundWhileReconnect = "onUserOnFoundWhileReconnect"
35
+ OnUserOnFoundWhileReconnect = "onUserOnFoundWhileReconnect",
36
+ OnNewPingFromServer = "OnNewPingFromServer"
36
37
  }
37
38
  interface VaniConnectionEvents {
38
39
  [VaniEvent.OnInitDone]: () => any;
@@ -52,6 +53,7 @@ interface VaniConnectionEvents {
52
53
  [VaniEvent.OnAllParticipants]: (participants: Participant[]) => any;
53
54
  [VaniEvent.OnParticipantDataUpdated]: (participants: Participant) => any;
54
55
  [VaniEvent.OnMeetingStartTime]: (time: string) => any;
56
+ [VaniEvent.OnNewPingFromServer]: () => any;
55
57
  [VaniEvent.OnOldMessages]: (messages: MessagePayload[]) => any;
56
58
  [VaniEvent.OnNewChatMessageReceived]: (message: MessagePayload) => any;
57
59
  [VaniEvent.OnSpeakerChanged]: (participant: Participant) => any;
@@ -31,4 +31,5 @@ export var VaniEvent;
31
31
  VaniEvent["OnReconectionTimeout"] = "reconectionTimeout";
32
32
  VaniEvent["OnReconecting"] = "reconecting";
33
33
  VaniEvent["OnUserOnFoundWhileReconnect"] = "onUserOnFoundWhileReconnect";
34
+ VaniEvent["OnNewPingFromServer"] = "OnNewPingFromServer";
34
35
  })(VaniEvent || (VaniEvent = {}));
@@ -406,7 +406,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
406
406
  }, 300);
407
407
  };
408
408
  WebsocketHandler.prototype.onMessage = function (message) {
409
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
409
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
410
410
  this.lastPingTimeStamp = new Date().getTime();
411
411
  // this.meetingStartRequest && this.meetingStartRequest.logLevel === LogLevel.Debug && console.log("lastPingTimeStamp time ", this.lastPingTimeStamp)
412
412
  var messagejson = JSON.parse(message);
@@ -416,9 +416,10 @@ var WebsocketHandler = /** @class */ (function (_super) {
416
416
  if (type === WebSocketBasicEvents.Ping) {
417
417
  this.pongData = data;
418
418
  this.sendSocketMessage(WebSocketBasicEvents.Pong, data);
419
+ (_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.emitMessageToSource(VaniEvent.OnNewPingFromServer, {});
419
420
  }
420
421
  else if (this.isVideoCallControllerMessageType(type)) {
421
- (_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.onVideoCallWebSocketMessage(messagejson);
422
+ (_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.onVideoCallWebSocketMessage(messagejson);
422
423
  return;
423
424
  }
424
425
  else if (type === WebSocketBasicEvents.IsSetupDone) {
@@ -428,31 +429,31 @@ var WebsocketHandler = /** @class */ (function (_super) {
428
429
  this.onCloseTheRoomForcefully(data);
429
430
  }
430
431
  else if (type === WebSocketBasicEvents.OnUserOnFoundWhileReconnect) {
431
- (_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.emitMessageToSource(VaniEvent.OnUserOnFoundWhileReconnect, {});
432
+ (_c = this.communicationHandler) === null || _c === void 0 ? void 0 : _c.emitMessageToSource(VaniEvent.OnUserOnFoundWhileReconnect, {});
432
433
  }
433
434
  else if (type === WebSocketBasicEvents.OnNewJoinee || type === WebSocketBasicEvents.OnRejoined) {
434
435
  if (data && data.message && data.message.participant) {
435
436
  this.meetingStartRequest && this.meetingStartRequest.logLevel === LogLevel.Debug && console.log("OnParticipantUpdated from server", data.message.participant);
436
- (_c = this.communicationHandler) === null || _c === void 0 ? void 0 : _c.addParticipantIfNotExist(data.message.participant, true);
437
+ (_d = this.communicationHandler) === null || _d === void 0 ? void 0 : _d.addParticipantIfNotExist(data.message.participant, true);
437
438
  }
438
439
  }
439
440
  else if (type === WebSocketBasicEvents.OnParticipantUpdated) {
440
441
  if (data) {
441
- (_d = this.communicationHandler) === null || _d === void 0 ? void 0 : _d.addParticipantIfNotExist(data.message, true);
442
+ (_e = this.communicationHandler) === null || _e === void 0 ? void 0 : _e.addParticipantIfNotExist(data.message, true);
442
443
  }
443
444
  }
444
445
  else if (type === WebSocketBasicEvents.OnUserLeft) {
445
- (_e = this.communicationHandler) === null || _e === void 0 ? void 0 : _e.onUserLeft(data);
446
+ (_f = this.communicationHandler) === null || _f === void 0 ? void 0 : _f.onUserLeft(data);
446
447
  }
447
448
  else if (type === WebSocketBasicEvents.OnServerParticipants) {
448
- (_f = this.communicationHandler) === null || _f === void 0 ? void 0 : _f.onServerParticipants(data);
449
+ (_g = this.communicationHandler) === null || _g === void 0 ? void 0 : _g.onServerParticipants(data);
449
450
  }
450
451
  else if (type === WebSocketBasicEvents.OnOldMessages) {
451
- (_g = this.communicationHandler) === null || _g === void 0 ? void 0 : _g.onOldMessages(data);
452
+ (_h = this.communicationHandler) === null || _h === void 0 ? void 0 : _h.onOldMessages(data);
452
453
  }
453
454
  else if (type === WebSocketBasicEvents.OnChat) {
454
455
  if (data.message) {
455
- (_h = this.communicationHandler) === null || _h === void 0 ? void 0 : _h.onMessage(data.message);
456
+ (_j = this.communicationHandler) === null || _j === void 0 ? void 0 : _j.onMessage(data.message);
456
457
  }
457
458
  }
458
459
  else if (type === WebSocketBasicEvents.OnMeetingStartTime) {
@@ -461,23 +462,23 @@ var WebsocketHandler = /** @class */ (function (_super) {
461
462
  if (time > new Date().getTime()) {
462
463
  time = new Date().getTime();
463
464
  }
464
- (_j = this.communicationHandler) === null || _j === void 0 ? void 0 : _j.emitMessageToSource(VaniEvent.OnMeetingStartTime, (time + ""));
465
+ (_k = this.communicationHandler) === null || _k === void 0 ? void 0 : _k.emitMessageToSource(VaniEvent.OnMeetingStartTime, (time + ""));
465
466
  }
466
467
  }
467
468
  else if (type === WebSocketBasicEvents.OnAudioVideoStatusUpdated) {
468
- (_k = this.communicationHandler) === null || _k === void 0 ? void 0 : _k.onAudioVideoStatusUpdated(data);
469
+ (_l = this.communicationHandler) === null || _l === void 0 ? void 0 : _l.onAudioVideoStatusUpdated(data);
469
470
  }
470
471
  else if (type === WebSocketBasicEvents.OnAudioBlockRequest) {
471
- (_l = this.communicationHandler) === null || _l === void 0 ? void 0 : _l.onAudioBlocked(data);
472
+ (_m = this.communicationHandler) === null || _m === void 0 ? void 0 : _m.onAudioBlocked(data);
472
473
  }
473
474
  else if (type === WebSocketBasicEvents.OnAudioUnblockRequest) {
474
- (_m = this.communicationHandler) === null || _m === void 0 ? void 0 : _m.onAudioUnblocked(data);
475
+ (_o = this.communicationHandler) === null || _o === void 0 ? void 0 : _o.onAudioUnblocked(data);
475
476
  }
476
477
  else if (type === WebSocketBasicEvents.OnVideoBlockRequest) {
477
- (_o = this.communicationHandler) === null || _o === void 0 ? void 0 : _o.onVideoBlocked(data);
478
+ (_p = this.communicationHandler) === null || _p === void 0 ? void 0 : _p.onVideoBlocked(data);
478
479
  }
479
480
  else if (type === WebSocketBasicEvents.OnVideoUnblockRequest) {
480
- (_p = this.communicationHandler) === null || _p === void 0 ? void 0 : _p.onVideoUnblocked(data);
481
+ (_q = this.communicationHandler) === null || _q === void 0 ? void 0 : _q.onVideoUnblocked(data);
481
482
  }
482
483
  }
483
484
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",