vani-meeting-client 0.4.6 → 0.4.9

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.
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  import { VaniEvent, MessagePayload } from "..";
38
38
  import { Participant } from "../model/Participant";
39
39
  import * as log from 'loglevel';
40
- import { Track } from "../model/Track";
40
+ import { Track, TrackKind } from "../model/Track";
41
41
  import { WebSocketBasicEvents } from "../websocket-handler/WebsocketHandler";
42
42
  import { VaniEventListener } from "../utility/VaniEventListener";
43
43
  import { Utility } from "../utility/Utility";
@@ -108,6 +108,7 @@ var CommunicationHandler = /** @class */ (function () {
108
108
  };
109
109
  CommunicationHandler.prototype.onServerParticipants = function (data) {
110
110
  var _this = this;
111
+ log.info(data);
111
112
  if (data && data.message) {
112
113
  var userIds = "";
113
114
  Object.entries(data.message).forEach(function (_a) {
@@ -194,6 +195,12 @@ var CommunicationHandler = /** @class */ (function () {
194
195
  CommunicationHandler.prototype.removeTrack = function (track, shouldInfromVideoController) {
195
196
  var _a;
196
197
  if (shouldInfromVideoController === void 0) { shouldInfromVideoController = true; }
198
+ if (track.trackKind === TrackKind.Audio) {
199
+ track.participant.isAudioEnable = false;
200
+ }
201
+ else if (track.trackKind === TrackKind.Video) {
202
+ track.participant.isVideoEnable = false;
203
+ }
197
204
  if (shouldInfromVideoController && this.isStartAndSetupWithServerCalled && track.isLocalTrack) {
198
205
  (_a = this.videoCallHandler) === null || _a === void 0 ? void 0 : _a.stopTrack(track);
199
206
  }
@@ -214,6 +221,12 @@ var CommunicationHandler = /** @class */ (function () {
214
221
  this.allTracks.push(track);
215
222
  }
216
223
  track.participant = participant;
224
+ if (track.trackKind === TrackKind.Audio) {
225
+ track.participant.isAudioEnable = true;
226
+ }
227
+ else if (track.trackKind === TrackKind.Video) {
228
+ track.participant.isVideoEnable = true;
229
+ }
217
230
  if (shouldInfromIfNotExist) {
218
231
  log.info("emitMessageToSource");
219
232
  this.emitMessageToSource(VaniEvent.OnTrack, track);
@@ -235,6 +248,12 @@ var CommunicationHandler = /** @class */ (function () {
235
248
  this.allTracks.push(track);
236
249
  this.selfTracks.push(track);
237
250
  }
251
+ if (track.trackKind === TrackKind.Audio) {
252
+ track.participant.isAudioEnable = true;
253
+ }
254
+ else if (track.trackKind === TrackKind.Video) {
255
+ track.participant.isVideoEnable = true;
256
+ }
238
257
  if (this.isStartAndSetupWithServerCalled) {
239
258
  (_a = this.videoCallHandler) === null || _a === void 0 ? void 0 : _a.sendTrack(track);
240
259
  }
@@ -446,8 +446,8 @@ var SFUHandler = /** @class */ (function (_super) {
446
446
  return __awaiter(this, void 0, void 0, function () {
447
447
  var producer, producerId, consumerAppData, cosumeObj, message;
448
448
  return __generator(this, function (_a) {
449
- console.log("onNewProducer");
450
- console.log(data);
449
+ // console.log("onNewProducer")
450
+ // console.log(data)
451
451
  if (this.consumerTransport && data && data.message && data.message.producer) {
452
452
  producer = data.message.producer;
453
453
  producerId = producer.id;
@@ -485,7 +485,7 @@ var SFUHandler = /** @class */ (function (_super) {
485
485
  if (message && message.message) {
486
486
  (_a = _this.communicationHandler) === null || _a === void 0 ? void 0 : _a.onMessage(message.message);
487
487
  }
488
- console.log("OnMessage Data Channel", message);
488
+ // console.log("OnMessage Data Channel", message)
489
489
  });
490
490
  });
491
491
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "0.4.6",
3
+ "version": "0.4.9",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",