vani-meeting-client 0.6.5 → 0.6.8

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.
@@ -71,7 +71,7 @@ var MeetingHandler = /** @class */ (function () {
71
71
  }
72
72
  log.setLevel("trace");
73
73
  (_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.setMeetingStartRequest(this.meetingStartRequest);
74
- if (!((_b = this.meetingStartRequest) === null || _b === void 0 ? void 0 : _b.isMobileApp)) return [3 /*break*/, 2];
74
+ if (!(((_b = this.meetingStartRequest) === null || _b === void 0 ? void 0 : _b.isMobileApp) && !this.reactNativeWebrtcPlugin)) return [3 /*break*/, 2];
75
75
  _d = this;
76
76
  return [4 /*yield*/, new DynamicLibHelper().getReactNativeWebrtcPlugin(this.meetingStartRequest)];
77
77
  case 1:
@@ -79,11 +79,16 @@ var MeetingHandler = /** @class */ (function () {
79
79
  this.reactNativeWebrtcPlugin.registerGlobals();
80
80
  _f.label = 2;
81
81
  case 2:
82
+ if (!!this.videoCallHandler) return [3 /*break*/, 4];
82
83
  _e = this;
83
84
  return [4 /*yield*/, new DynamicLibHelper().getVideoCallClassHandler((_c = this.meetingStartRequest) === null || _c === void 0 ? void 0 : _c.meetingType, this.meetingStartRequest, this.communicationHandler)];
84
85
  case 3:
85
86
  _e.videoCallHandler = _f.sent();
86
- this.websocketCallHandler = new WebsocketHandler(this.meetingStartRequest, this.communicationHandler);
87
+ _f.label = 4;
88
+ case 4:
89
+ if (!this.websocketCallHandler) {
90
+ this.websocketCallHandler = new WebsocketHandler(this.meetingStartRequest, this.communicationHandler);
91
+ }
87
92
  // this.handleGA();
88
93
  this.emitMessageToSource(VaniEvent.OnInitDone, {});
89
94
  return [2 /*return*/];
@@ -311,10 +316,9 @@ var MeetingHandler = /** @class */ (function () {
311
316
  return [];
312
317
  };
313
318
  MeetingHandler.prototype.isWebScoketConnected = function () {
314
- var _a, _b;
315
- console.log("Room Id", (_a = this.meetingStartRequest) === null || _a === void 0 ? void 0 : _a.roomId);
319
+ var _a;
316
320
  if (this.websocketCallHandler) {
317
- return (_b = this.websocketCallHandler) === null || _b === void 0 ? void 0 : _b.isWebScoketConnected();
321
+ return (_a = this.websocketCallHandler) === null || _a === void 0 ? void 0 : _a.isWebScoketConnected();
318
322
  }
319
323
  return false;
320
324
  };
@@ -1,8 +1,9 @@
1
1
  import { MeetingStartRequest, MeetingType } from '..';
2
2
  import { CommunicationHandler } from '../inter-communication-handler/CommunicationHandler';
3
+ import { SFUHandler } from '../video-call-handler/SFUHandler';
3
4
  export declare class DynamicLibHelper {
4
5
  getReactNativeWebrtcPlugin(meetingStartRequest: MeetingStartRequest): Promise<any>;
5
- getVideoCallClassHandler(meetingType: MeetingType, meetingStartRequest: MeetingStartRequest, _communicationHandler: CommunicationHandler): Promise<import("../video-call-handler/SFUHandler").SFUHandler | import("../video-call-handler/WebrtcHandler").WebrtcHandler | undefined>;
6
+ getVideoCallClassHandler(meetingType: MeetingType, meetingStartRequest: MeetingStartRequest, _communicationHandler: CommunicationHandler): Promise<SFUHandler | import("../video-call-handler/WebrtcHandler").WebrtcHandler | undefined>;
6
7
  getMediaDevicesVariable(meetingStartRequest: MeetingStartRequest): any;
7
8
  getMediaStreamVariable(meetingStartRequest: MeetingStartRequest): any;
8
9
  }
@@ -36,6 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  };
37
37
  import { MeetingType } from '..';
38
38
  import * as log from 'loglevel';
39
+ import { SFUHandler } from '../video-call-handler/SFUHandler';
39
40
  var DynamicLibHelper = /** @class */ (function () {
40
41
  function DynamicLibHelper() {
41
42
  }
@@ -61,21 +62,18 @@ var DynamicLibHelper = /** @class */ (function () {
61
62
  return __generator(this, function (_a) {
62
63
  switch (_a.label) {
63
64
  case 0:
64
- if (!(meetingType === MeetingType.SFU)) return [3 /*break*/, 2];
65
- return [4 /*yield*/, import("../video-call-handler/SFUHandler")];
66
- case 1:
67
- baseVideoCallHandler = _a.sent();
68
- if (baseVideoCallHandler) {
69
- return [2 /*return*/, new baseVideoCallHandler.SFUHandler(meetingStartRequest, _communicationHandler)];
65
+ if (meetingType === MeetingType.SFU) {
66
+ baseVideoCallHandler = SFUHandler;
67
+ if (baseVideoCallHandler) {
68
+ return [2 /*return*/, new baseVideoCallHandler(meetingStartRequest, _communicationHandler)];
69
+ }
70
70
  }
71
- _a.label = 2;
72
- case 2:
73
- if (!(meetingType === MeetingType.WEBRTC)) return [3 /*break*/, 4];
71
+ if (!(meetingType === MeetingType.WEBRTC)) return [3 /*break*/, 2];
74
72
  baseVideoCallHandler = import("../video-call-handler/WebrtcHandler");
75
- if (!baseVideoCallHandler) return [3 /*break*/, 4];
73
+ if (!baseVideoCallHandler) return [3 /*break*/, 2];
76
74
  return [4 /*yield*/, baseVideoCallHandler];
77
- case 3: return [2 /*return*/, new (_a.sent()).WebrtcHandler(meetingStartRequest, _communicationHandler)];
78
- case 4: return [2 /*return*/, undefined];
75
+ case 1: return [2 /*return*/, new (_a.sent()).WebrtcHandler(meetingStartRequest, _communicationHandler)];
76
+ case 2: return [2 /*return*/, undefined];
79
77
  }
80
78
  });
81
79
  });
@@ -137,6 +137,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
137
137
  if (this.wss) {
138
138
  this.wss.close();
139
139
  this.wss = undefined;
140
+ console.log("this.wss undefined cleanup ");
140
141
  }
141
142
  if (this.socketCheckTimeout) {
142
143
  window.clearTimeout(this.socketCheckTimeout);
@@ -231,6 +232,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
231
232
  };
232
233
  this.wss.onerror = function (event) {
233
234
  var _a;
235
+ console.log("wss error", event);
234
236
  _this.isWebSocketConnectionInProgress = false;
235
237
  (_a = _this.communicationHandler) === null || _a === void 0 ? void 0 : _a.emitMessageToSource(VaniEvent.OnSocketError, event);
236
238
  if (_this.wss) {
@@ -257,7 +259,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
257
259
  if (this.wss && this.wss.readyState === 1) {
258
260
  return true;
259
261
  }
260
- console.log("this.wss.readyState", (_a = this.wss) === null || _a === void 0 ? void 0 : _a.readyState);
262
+ console.log("this.wss.readyState", this.wss, (_a = this.wss) === null || _a === void 0 ? void 0 : _a.readyState);
261
263
  return false;
262
264
  };
263
265
  WebsocketHandler.prototype.sendSocketMessage = function (type, data) {
@@ -274,6 +276,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
274
276
  (_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.emitMessageToSource(VaniEvent.OnReconecting, {});
275
277
  this.wss.close(3005);
276
278
  this.wss = undefined;
279
+ console.log("this.wss undefined reconnectOnInternetFailur ");
277
280
  this.connection = ConnectionType.reconnect;
278
281
  this.connect(true);
279
282
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "0.6.5",
3
+ "version": "0.6.8",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",