vani-meeting-client-native 0.4.6-beta5 → 0.4.7-beta1

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.
@@ -272,11 +272,11 @@ var SFUHandler = /** @class */ (function (_super) {
272
272
  });
273
273
  };
274
274
  SFUHandler.prototype.onRestartIceCandidateResponse = function (data) {
275
- var _a;
275
+ var _a, _b;
276
276
  return __awaiter(this, void 0, void 0, function () {
277
277
  var transportId, iceParameters;
278
- return __generator(this, function (_b) {
279
- switch (_b.label) {
278
+ return __generator(this, function (_c) {
279
+ switch (_c.label) {
280
280
  case 0:
281
281
  transportId = data.message.transportId;
282
282
  iceParameters = data.message.iceParameters;
@@ -285,17 +285,17 @@ var SFUHandler = /** @class */ (function (_super) {
285
285
  this.meetingStartRequest && this.meetingStartRequest.logLevel === LogLevel.Debug && console.log("Restat Ice consumer");
286
286
  return [4 /*yield*/, this.consumerTransport.restartIce({ iceParameters: iceParameters })];
287
287
  case 1:
288
- _b.sent();
288
+ _c.sent();
289
289
  return [3 /*break*/, 4];
290
290
  case 2:
291
291
  if (!(this.sendTransport && this.sendTransport.id === transportId)) return [3 /*break*/, 4];
292
292
  this.meetingStartRequest && this.meetingStartRequest.logLevel === LogLevel.Debug && console.log("Restat Ice sender");
293
293
  return [4 /*yield*/, this.sendTransport.restartIce({ iceParameters: iceParameters })];
294
294
  case 3:
295
- _b.sent();
296
- _b.label = 4;
295
+ _c.sent();
296
+ _c.label = 4;
297
297
  case 4:
298
- this.communicationHandler.onReconnect(false);
298
+ (_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.onReconnect(false);
299
299
  return [2 /*return*/];
300
300
  }
301
301
  });
@@ -670,8 +670,9 @@ var SFUHandler = /** @class */ (function (_super) {
670
670
  });
671
671
  };
672
672
  SFUHandler.prototype.onRouterRtpCapabilities = function (data) {
673
+ var _a;
673
674
  try {
674
- if (this.getDevice() && this.getDevice().loaded) {
675
+ if (this.getDevice() && ((_a = this.getDevice()) === null || _a === void 0 ? void 0 : _a.loaded)) {
675
676
  return;
676
677
  }
677
678
  if (data && data.message && data.message.rtpCapabilities) {
@@ -565,10 +565,13 @@ var WebrtcHandler = /** @class */ (function (_super) {
565
565
  }
566
566
  });
567
567
  rtcConnection.addEventListener('signalingstatechange', function (event) {
568
+ var _a;
568
569
  _this.printLogIfRequired("signalingstatechange", event, rtcConnection.signalingState);
569
- if (rtcConnection.signalingState === 'stable') {
570
- peerConnectionObject.isCreatingOffer = false;
571
- if (peerConnectionObject.isNegotiationNeeded) {
570
+ var selfParticpant = (_a = _this.communicationHandler) === null || _a === void 0 ? void 0 : _a.getSelfParticipant();
571
+ var innerPeerConnectionObject = selfParticpant === null || selfParticpant === void 0 ? void 0 : selfParticpant.isPeerConnectionsViaUserIdPresent(remoteParticipant.userId);
572
+ if (innerPeerConnectionObject && rtcConnection.signalingState === 'stable') {
573
+ innerPeerConnectionObject.isCreatingOffer = false;
574
+ if (innerPeerConnectionObject.isNegotiationNeeded) {
572
575
  _this.onNegotiationNeeded(remoteParticipant, false, 0, true);
573
576
  }
574
577
  }
@@ -583,13 +586,16 @@ var WebrtcHandler = /** @class */ (function (_super) {
583
586
  // }
584
587
  // })
585
588
  rtcConnection.addEventListener('negotiationneeded', function (event) {
586
- _this.printLogIfRequired("negotiationneeded", rtcConnection.signalingState, remoteParticipant);
587
- if (!peerConnectionObject.offer && !peerConnectionObject.answer) {
588
- _this.printLogIfRequired("negotiationneeded ignored", rtcConnection.signalingState, remoteParticipant);
589
+ var _a;
590
+ _this.printLogIfRequired("negotiationneeded", rtcConnection.signalingState, remoteParticipant, peerConnectionObject);
591
+ var selfParticpant = (_a = _this.communicationHandler) === null || _a === void 0 ? void 0 : _a.getSelfParticipant();
592
+ var innerPeerConnectionObject = selfParticpant === null || selfParticpant === void 0 ? void 0 : selfParticpant.isPeerConnectionsViaUserIdPresent(remoteParticipant.userId);
593
+ if (!innerPeerConnectionObject || (!innerPeerConnectionObject.offer && !innerPeerConnectionObject.answer)) {
594
+ _this.printLogIfRequired("negotiationneeded ignored", rtcConnection.signalingState, remoteParticipant, peerConnectionObject);
589
595
  return;
590
596
  }
591
- peerConnectionObject.isNegotiationNeeded = true;
592
- peerConnectionObject.negotiationId = new Date().getTime() + "_" + (Math.floor(Math.random() * 100) + 1);
597
+ innerPeerConnectionObject.isNegotiationNeeded = true;
598
+ innerPeerConnectionObject.negotiationId = new Date().getTime() + "_" + (Math.floor(Math.random() * 100) + 1);
593
599
  if (rtcConnection.signalingState === 'stable') {
594
600
  _this.onNegotiationNeeded(remoteParticipant, false, 0, true);
595
601
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client-native",
3
- "version": "0.4.6beta5",
3
+ "version": "0.4.7beta1",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",