vani-meeting-client 0.8.3 → 0.8.4

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.
@@ -29,7 +29,8 @@ export declare enum VaniEvent {
29
29
  OnSpeakerChanged = "onSpeakerChanged",
30
30
  OnNotReachable = "notReachable",
31
31
  OnReconectionTimeout = "reconectionTimeout",
32
- OnReconecting = "reconecting"
32
+ OnReconecting = "reconecting",
33
+ OnUserOnFoundWhileReconnect = "onUserOnFoundWhileReconnect"
33
34
  }
34
35
  interface VaniConnectionEvents {
35
36
  [VaniEvent.OnInitDone]: () => any;
@@ -55,6 +56,7 @@ interface VaniConnectionEvents {
55
56
  [VaniEvent.OnNotReachable]: () => any;
56
57
  [VaniEvent.OnReconectionTimeout]: () => any;
57
58
  [VaniEvent.OnReconecting]: () => any;
59
+ [VaniEvent.OnUserOnFoundWhileReconnect]: () => any;
58
60
  [VaniEvent.OnVideoUnblocked]: (participant: Participant) => any;
59
61
  [VaniEvent.OnAudioUnblocked]: (participant: Participant) => any;
60
62
  [VaniEvent.OnVideoBlocked]: (participant: Participant) => any;
@@ -28,4 +28,5 @@ export var VaniEvent;
28
28
  VaniEvent["OnNotReachable"] = "notReachable";
29
29
  VaniEvent["OnReconectionTimeout"] = "reconectionTimeout";
30
30
  VaniEvent["OnReconecting"] = "reconecting";
31
+ VaniEvent["OnUserOnFoundWhileReconnect"] = "onUserOnFoundWhileReconnect";
31
32
  })(VaniEvent || (VaniEvent = {}));
@@ -16,6 +16,8 @@ export declare enum WebSocketBasicEvents {
16
16
  UpdateParticipant = "updateParticipant",
17
17
  OnParticipantUpdated = "participantUpdated",
18
18
  OnNewJoinee = "newJoinee",
19
+ OnUserOnFoundWhileReconnect = "onUserOnFoundWhileReconnect",
20
+ OnRejoined = "OnRejoined",
19
21
  OnUserLeft = "userLeft",
20
22
  GetAllParticipant = "getParticipant",
21
23
  OnServerParticipants = "participants",
@@ -71,6 +71,8 @@ export var WebSocketBasicEvents;
71
71
  WebSocketBasicEvents["UpdateParticipant"] = "updateParticipant";
72
72
  WebSocketBasicEvents["OnParticipantUpdated"] = "participantUpdated";
73
73
  WebSocketBasicEvents["OnNewJoinee"] = "newJoinee";
74
+ WebSocketBasicEvents["OnUserOnFoundWhileReconnect"] = "onUserOnFoundWhileReconnect";
75
+ WebSocketBasicEvents["OnRejoined"] = "OnRejoined";
74
76
  WebSocketBasicEvents["OnUserLeft"] = "userLeft";
75
77
  WebSocketBasicEvents["GetAllParticipant"] = "getParticipant";
76
78
  WebSocketBasicEvents["OnServerParticipants"] = "participants";
@@ -371,7 +373,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
371
373
  }, 200);
372
374
  };
373
375
  WebsocketHandler.prototype.onMessage = function (message) {
374
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
376
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
375
377
  this.lastPingTimeStamp = new Date().getTime();
376
378
  var messagejson = JSON.parse(message);
377
379
  if (messagejson.type && messagejson.data) {
@@ -387,29 +389,32 @@ var WebsocketHandler = /** @class */ (function (_super) {
387
389
  else if (type === WebSocketBasicEvents.IsSetupDone) {
388
390
  this.onSetupDone(data);
389
391
  }
390
- else if (type === WebSocketBasicEvents.OnNewJoinee) {
392
+ else if (type === WebSocketBasicEvents.OnUserOnFoundWhileReconnect) {
393
+ (_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.emitMessageToSource(VaniEvent.OnUserOnFoundWhileReconnect, {});
394
+ }
395
+ else if (type === WebSocketBasicEvents.OnNewJoinee || type === WebSocketBasicEvents.OnRejoined) {
391
396
  if (data && data.message && data.message.participant) {
392
397
  console.log("OnParticipantUpdated from server", data.message.participant);
393
- (_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.addParticipantIfNotExist(data.message.participant, true);
398
+ (_c = this.communicationHandler) === null || _c === void 0 ? void 0 : _c.addParticipantIfNotExist(data.message.participant, true);
394
399
  }
395
400
  }
396
401
  else if (type === WebSocketBasicEvents.OnParticipantUpdated) {
397
402
  if (data) {
398
- (_c = this.communicationHandler) === null || _c === void 0 ? void 0 : _c.addParticipantIfNotExist(data, true);
403
+ (_d = this.communicationHandler) === null || _d === void 0 ? void 0 : _d.addParticipantIfNotExist(data, true);
399
404
  }
400
405
  }
401
406
  else if (type === WebSocketBasicEvents.OnUserLeft) {
402
- (_d = this.communicationHandler) === null || _d === void 0 ? void 0 : _d.onUserLeft(data);
407
+ (_e = this.communicationHandler) === null || _e === void 0 ? void 0 : _e.onUserLeft(data);
403
408
  }
404
409
  else if (type === WebSocketBasicEvents.OnServerParticipants) {
405
- (_e = this.communicationHandler) === null || _e === void 0 ? void 0 : _e.onServerParticipants(data);
410
+ (_f = this.communicationHandler) === null || _f === void 0 ? void 0 : _f.onServerParticipants(data);
406
411
  }
407
412
  else if (type === WebSocketBasicEvents.OnOldMessages) {
408
- (_f = this.communicationHandler) === null || _f === void 0 ? void 0 : _f.onOldMessages(data);
413
+ (_g = this.communicationHandler) === null || _g === void 0 ? void 0 : _g.onOldMessages(data);
409
414
  }
410
415
  else if (type === WebSocketBasicEvents.OnChat) {
411
416
  if (data.message) {
412
- (_g = this.communicationHandler) === null || _g === void 0 ? void 0 : _g.onMessage(data.message);
417
+ (_h = this.communicationHandler) === null || _h === void 0 ? void 0 : _h.onMessage(data.message);
413
418
  }
414
419
  }
415
420
  else if (type === WebSocketBasicEvents.OnMeetingStartTime) {
@@ -418,23 +423,23 @@ var WebsocketHandler = /** @class */ (function (_super) {
418
423
  if (time > new Date().getTime()) {
419
424
  time = new Date().getTime();
420
425
  }
421
- (_h = this.communicationHandler) === null || _h === void 0 ? void 0 : _h.emitMessageToSource(VaniEvent.OnMeetingStartTime, (time + ""));
426
+ (_j = this.communicationHandler) === null || _j === void 0 ? void 0 : _j.emitMessageToSource(VaniEvent.OnMeetingStartTime, (time + ""));
422
427
  }
423
428
  }
424
429
  else if (type === WebSocketBasicEvents.OnAudioVideoStatusUpdated) {
425
- (_j = this.communicationHandler) === null || _j === void 0 ? void 0 : _j.onAudioVideoStatusUpdated(data);
430
+ (_k = this.communicationHandler) === null || _k === void 0 ? void 0 : _k.onAudioVideoStatusUpdated(data);
426
431
  }
427
432
  else if (type === WebSocketBasicEvents.OnAudioBlockRequest) {
428
- (_k = this.communicationHandler) === null || _k === void 0 ? void 0 : _k.onAudioBlocked(data);
433
+ (_l = this.communicationHandler) === null || _l === void 0 ? void 0 : _l.onAudioBlocked(data);
429
434
  }
430
435
  else if (type === WebSocketBasicEvents.OnAudioUnblockRequest) {
431
- (_l = this.communicationHandler) === null || _l === void 0 ? void 0 : _l.onAudioUnblocked(data);
436
+ (_m = this.communicationHandler) === null || _m === void 0 ? void 0 : _m.onAudioUnblocked(data);
432
437
  }
433
438
  else if (type === WebSocketBasicEvents.OnVideoBlockRequest) {
434
- (_m = this.communicationHandler) === null || _m === void 0 ? void 0 : _m.onVideoBlocked(data);
439
+ (_o = this.communicationHandler) === null || _o === void 0 ? void 0 : _o.onVideoBlocked(data);
435
440
  }
436
441
  else if (type === WebSocketBasicEvents.OnVideoUnblockRequest) {
437
- (_o = this.communicationHandler) === null || _o === void 0 ? void 0 : _o.onVideoUnblocked(data);
442
+ (_p = this.communicationHandler) === null || _p === void 0 ? void 0 : _p.onVideoUnblocked(data);
438
443
  }
439
444
  }
440
445
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",