vani-meeting-client 1.1.2 → 1.1.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.
@@ -131,7 +131,7 @@ var CommunicationHandler = /** @class */ (function () {
131
131
  return this.allParticipants.find(function (participant) { return participant.userId === userId; });
132
132
  };
133
133
  CommunicationHandler.prototype.addParticipantIfNotExist = function (participant, shouldInfrom) {
134
- var _a, _b, _c;
134
+ var _a;
135
135
  if (shouldInfrom === void 0) { shouldInfrom = false; }
136
136
  console.log("addParticipantIfNotExist", this.allParticipants);
137
137
  console.log("addParticipantIfNotExist new user", participant);
@@ -145,22 +145,26 @@ var CommunicationHandler = /** @class */ (function () {
145
145
  this.emitMessageToSource(VaniEvent.OnParticipantDataUpdated, oldParticipant);
146
146
  }
147
147
  this.updateParticipantAudioVideoDataAccordingToTrack(oldParticipant);
148
- if (oldParticipant.userId === ((_a = this.meetingStartRequest) === null || _a === void 0 ? void 0 : _a.userId)) {
149
- this.meetingStartRequest.userData = oldParticipant.userData;
150
- }
148
+ // try {
149
+ // if (oldParticipant.userId === this.meetingStartRequest?.userId) {
150
+ // this.meetingStartRequest.userData = oldParticipant.userData
151
+ // }
152
+ // }
153
+ // catch (err) {
154
+ // }
151
155
  return oldParticipant;
152
156
  }
153
157
  else {
154
158
  participant = Object.assign(new Participant(participant.userId, participant.roomId, participant.userData, participant.isAdmin), participant);
155
159
  this.updateParticipantAudioVideoDataAccordingToTrack(participant);
156
- if (participant.userId === ((_b = this.meetingStartRequest) === null || _b === void 0 ? void 0 : _b.userId)) {
157
- this.meetingStartRequest.userData = participant.userData;
158
- }
160
+ // if (participant.userId === this.meetingStartRequest?.userId) {
161
+ // this.meetingStartRequest.userData = participant.userData
162
+ // }
159
163
  this.allParticipants.push(participant);
160
164
  if (shouldInfrom) {
161
165
  this.emitMessageToSource(VaniEvent.OnUserJoined, participant);
162
166
  }
163
- (_c = this.videoCallHandler) === null || _c === void 0 ? void 0 : _c.onParticipantUpdated();
167
+ (_a = this.videoCallHandler) === null || _a === void 0 ? void 0 : _a.onParticipantUpdated();
164
168
  return participant;
165
169
  }
166
170
  };
@@ -136,8 +136,10 @@ var SFUHandler = /** @class */ (function (_super) {
136
136
  var messageJson = { to: "self", type: SFUMessageType.OnProducerClosed, message: { producerId: producer.id } };
137
137
  this.sendSFUMessageToSocket(messageJson);
138
138
  var index = this.producers.indexOf(producer);
139
+ console.log("stopTrack ", index);
139
140
  if (index > -1) {
140
141
  this.producers.splice(index, 1);
142
+ console.log("stopTrack producers", this.producers);
141
143
  }
142
144
  }
143
145
  };
@@ -202,7 +204,7 @@ var SFUHandler = /** @class */ (function (_super) {
202
204
  case 0:
203
205
  if (!(track && track.track)) return [3 /*break*/, 4];
204
206
  producer = this.producers.find(function (producer) { return producer.appData.trackId === track.trackId; });
205
- if (!producer) return [3 /*break*/, 2];
207
+ if (!(producer && producer.closed === false)) return [3 /*break*/, 2];
206
208
  return [4 /*yield*/, producer.replaceTrack({ track: track.track })];
207
209
  case 1:
208
210
  _d.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",