vani-meeting-client 1.4.8 → 1.5.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.
@@ -76,6 +76,7 @@ export declare class WebsocketHandler extends Base {
76
76
  private socketCheckTimeout?;
77
77
  private pingCheckTimeout?;
78
78
  private setUpTry;
79
+ private pongData;
79
80
  private lastPingTimeStamp;
80
81
  protected onObjectCreated(): void;
81
82
  cleanup(): void;
@@ -131,6 +131,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
131
131
  _this.connection = ConnectionType.new;
132
132
  _this.isSetUpDone = false;
133
133
  _this.setUpTry = 0;
134
+ _this.pongData = undefined;
134
135
  _this.lastPingTimeStamp = 0;
135
136
  return _this;
136
137
  }
@@ -381,11 +382,13 @@ var WebsocketHandler = /** @class */ (function (_super) {
381
382
  WebsocketHandler.prototype.onMessage = function (message) {
382
383
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
383
384
  this.lastPingTimeStamp = new Date().getTime();
385
+ console.log("lastPingTimeStamp time ", this.lastPingTimeStamp);
384
386
  var messagejson = JSON.parse(message);
385
387
  if (messagejson.type && messagejson.data) {
386
388
  var type = messagejson.type;
387
389
  var data = messagejson.data;
388
390
  if (type === WebSocketBasicEvents.Ping) {
391
+ this.pongData = data;
389
392
  this.sendSocketMessage(WebSocketBasicEvents.Pong, data);
390
393
  }
391
394
  else if (this.isVideoCallControllerMessageType(type)) {
@@ -480,8 +483,12 @@ var WebsocketHandler = /** @class */ (function (_super) {
480
483
  var _this = this;
481
484
  var _a, _b;
482
485
  if (this.isWebScoketConnected()) {
483
- if ((this.lastPingTimeStamp + (40 * 1000)) < new Date().getTime()) {
486
+ if (this.pongData) {
487
+ this.sendSocketMessage(WebSocketBasicEvents.Pong, this.pongData);
488
+ }
489
+ if ((this.lastPingTimeStamp + (80 * 1000)) < new Date().getTime()) {
484
490
  this.pingCheckTimeout = undefined;
491
+ console.log("checkIfPingIsRunning", this.lastPingTimeStamp);
485
492
  //Discounted
486
493
  (_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.onIceCandidateDisconnected();
487
494
  (_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.emitMessageToSource(VaniEvent.OnNotReachable, {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "1.4.8",
3
+ "version": "1.5.0",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",