vani-meeting-client 0.4.3 → 0.4.6

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.
@@ -108,12 +108,12 @@ var MeetingHandler = /** @class */ (function () {
108
108
  log.error("Init method not called");
109
109
  return [2 /*return*/];
110
110
  }
111
- if (isVideoRequired === false && isAudioRequired === false) {
112
- return [2 /*return*/];
113
- }
114
111
  if (!this.userMediaHandler) {
115
112
  this.userMediaHandler = new UserMediaHandler(this.meetingStartRequest, this.communicationHandler);
116
113
  }
114
+ if (isVideoRequired === false && isAudioRequired === false) {
115
+ return [2 /*return*/];
116
+ }
117
117
  this.userMediaHandler.startLocalStream(isVideoRequired, isAudioRequired, shouldAddTrackImmediately, userMediaPayload);
118
118
  return [2 /*return*/];
119
119
  });
@@ -133,18 +133,14 @@ var CommunicationHandler = /** @class */ (function () {
133
133
  if (shouldInfrom === void 0) { shouldInfrom = false; }
134
134
  var oldParticipant = this.participantByUserId(participant.userId);
135
135
  if (oldParticipant) {
136
- console.log("oldParticipant");
137
136
  oldParticipant = Object.assign(oldParticipant, participant);
138
137
  if (shouldInfrom) {
139
138
  this.emitMessageToSource(VaniEvent.OnParticipantDataUpdated, oldParticipant);
140
139
  }
141
- console.log(oldParticipant);
142
140
  return oldParticipant;
143
141
  }
144
142
  else {
145
- console.log("new participant");
146
143
  participant = Object.assign(new Participant(participant.userId, participant.roomId, participant.userData, participant.isAdmin), participant);
147
- console.log(participant);
148
144
  this.allParticipants.push(participant);
149
145
  if (shouldInfrom) {
150
146
  this.emitMessageToSource(VaniEvent.OnUserJoined, participant);
@@ -209,14 +205,17 @@ var CommunicationHandler = /** @class */ (function () {
209
205
  if (shouldInfromIfNotExist === void 0) { shouldInfromIfNotExist = false; }
210
206
  var oldTrack = this.getTrackById(track.trackId);
211
207
  if (oldTrack) {
208
+ log.info("oldtrack found");
212
209
  track = Object.assign(oldTrack, track);
213
210
  }
214
211
  else {
212
+ log.info("new track found");
215
213
  track = Object.assign(new Track(participant, track.isLocalTrack, track.trackKind, track.track), track);
216
214
  this.allTracks.push(track);
217
215
  }
218
216
  track.participant = participant;
219
217
  if (shouldInfromIfNotExist) {
218
+ log.info("emitMessageToSource");
220
219
  this.emitMessageToSource(VaniEvent.OnTrack, track);
221
220
  }
222
221
  return track;
@@ -473,8 +473,8 @@ var SFUHandler = /** @class */ (function (_super) {
473
473
  var _this = this;
474
474
  return __generator(this, function (_a) {
475
475
  log.info("onServerConsumer");
476
+ log.info(data);
476
477
  if (this.consumerTransport && data && data.message && data.message.consumer) {
477
- log.info(data);
478
478
  if (data.message.consumer.appData.producerData.trackKind === TrackKind.DataChannel) {
479
479
  consumerObj = data.message.consumer;
480
480
  this.consumerTransport.consumeData(consumerObj).then(function (consumer) {
@@ -491,10 +491,8 @@ var SFUHandler = /** @class */ (function (_super) {
491
491
  }
492
492
  else {
493
493
  consumerObj = data.message.consumer;
494
- log.info("consume");
495
494
  this.consumerTransport.consume(consumerObj).then(function (consumer) {
496
495
  var _a, _b;
497
- log.info("on consumed");
498
496
  _this.consumers.push(consumer);
499
497
  var mediaTrack = consumer.track;
500
498
  var data = consumer.appData.producerData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "0.4.3",
3
+ "version": "0.4.6",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",