vani-meeting-client 0.6.8 → 0.7.1

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.
@@ -61,7 +61,7 @@ var MeetingHandler = /** @class */ (function () {
61
61
  MeetingHandler.prototype.init = function () {
62
62
  var _a, _b, _c;
63
63
  return __awaiter(this, void 0, void 0, function () {
64
- var _d, _e;
64
+ var _d, _e, err_1;
65
65
  return __generator(this, function (_f) {
66
66
  switch (_f.label) {
67
67
  case 0:
@@ -79,15 +79,26 @@ var MeetingHandler = /** @class */ (function () {
79
79
  this.reactNativeWebrtcPlugin.registerGlobals();
80
80
  _f.label = 2;
81
81
  case 2:
82
+ _f.trys.push([2, 5, , 6]);
82
83
  if (!!this.videoCallHandler) return [3 /*break*/, 4];
83
84
  _e = this;
84
85
  return [4 /*yield*/, new DynamicLibHelper().getVideoCallClassHandler((_c = this.meetingStartRequest) === null || _c === void 0 ? void 0 : _c.meetingType, this.meetingStartRequest, this.communicationHandler)];
85
86
  case 3:
86
87
  _e.videoCallHandler = _f.sent();
87
88
  _f.label = 4;
88
- case 4:
89
- if (!this.websocketCallHandler) {
90
- this.websocketCallHandler = new WebsocketHandler(this.meetingStartRequest, this.communicationHandler);
89
+ case 4: return [3 /*break*/, 6];
90
+ case 5:
91
+ err_1 = _f.sent();
92
+ console.log("his.videoCallHandler error", err_1);
93
+ return [3 /*break*/, 6];
94
+ case 6:
95
+ try {
96
+ if (!this.websocketCallHandler) {
97
+ this.websocketCallHandler = new WebsocketHandler(this.meetingStartRequest, this.communicationHandler);
98
+ }
99
+ }
100
+ catch (err) {
101
+ console.log("his.websocketCallHandler error", err);
91
102
  }
92
103
  // this.handleGA();
93
104
  this.emitMessageToSource(VaniEvent.OnInitDone, {});
@@ -228,15 +228,17 @@ var SFUHandler = /** @class */ (function (_super) {
228
228
  });
229
229
  };
230
230
  SFUHandler.prototype.onParticipantUpdated = function () {
231
- if (!this.communicationHandler || this.communicationHandler.getAllParticipants().length < 2) {
232
- this.producers.forEach(function (producer) {
233
- producer.pause();
234
- });
235
- }
236
- else {
237
- this.producers.forEach(function (producer) {
238
- producer.resume();
239
- });
231
+ if (this.producers) {
232
+ if (!this.communicationHandler || this.communicationHandler.getAllParticipants().length < 2) {
233
+ this.producers.forEach(function (producer) {
234
+ producer.pause();
235
+ });
236
+ }
237
+ else {
238
+ this.producers.forEach(function (producer) {
239
+ producer.resume();
240
+ });
241
+ }
240
242
  }
241
243
  };
242
244
  SFUHandler.prototype.sendMessageViaDataChannel = function (messagePayload) {
@@ -530,11 +532,13 @@ var SFUHandler = /** @class */ (function (_super) {
530
532
  this.consumerTransport.close();
531
533
  this.consumerTransport = undefined;
532
534
  }
533
- this.producers.forEach(function (producer) {
534
- if (producer.closed === false) {
535
- producer.close();
536
- }
537
- });
535
+ if (this.producers) {
536
+ this.producers.forEach(function (producer) {
537
+ if (producer.closed === false) {
538
+ producer.close();
539
+ }
540
+ });
541
+ }
538
542
  this.dataProducers.forEach(function (producer) {
539
543
  if (producer.closed === false) {
540
544
  producer.close();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "0.6.8",
3
+ "version": "0.7.1",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",