vani-meeting-client 0.2.4 → 0.2.7

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.
@@ -422,7 +422,7 @@ var MeetingHandler = /** @class */ (function () {
422
422
  })
423
423
  ]
424
424
  });
425
- analytics.page();
425
+ // analytics.page()
426
426
  analytics.track('event', {
427
427
  category: 'AppId',
428
428
  label: this.meetingStartRequest.appId,
@@ -305,16 +305,52 @@ var CommunicationHandler = /** @class */ (function () {
305
305
  (_d = this.videoCallHandler) === null || _d === void 0 ? void 0 : _d.init();
306
306
  };
307
307
  CommunicationHandler.prototype.onAudioBlocked = function (data) {
308
+ var _a, _b, _c;
308
309
  log.info(data);
310
+ if (data.message.user) {
311
+ var participant = this.participantByUserId(data.message.user);
312
+ if (participant) {
313
+ participant.isAudioBlockedByAdmin = true;
314
+ if ((participant === null || participant === void 0 ? void 0 : participant.userId) === ((_a = this.meetingStartRequest) === null || _a === void 0 ? void 0 : _a.userId)) {
315
+ (_b = this.meetingHandler) === null || _b === void 0 ? void 0 : _b.muteUser((_c = this.meetingStartRequest) === null || _c === void 0 ? void 0 : _c.userId);
316
+ }
317
+ this.emitMessageToSource(VaniEvent.OnAudioBlocked, participant);
318
+ }
319
+ }
309
320
  };
310
321
  CommunicationHandler.prototype.onAudioUnblocked = function (data) {
311
322
  log.info(data);
323
+ if (data.message.user) {
324
+ var participant = this.participantByUserId(data.message.user);
325
+ if (participant) {
326
+ participant.isAudioBlockedByAdmin = false;
327
+ this.emitMessageToSource(VaniEvent.OnAudioUnblocked, participant);
328
+ }
329
+ }
312
330
  };
313
331
  CommunicationHandler.prototype.onVideoBlocked = function (data) {
332
+ var _a, _b, _c;
314
333
  log.info(data);
334
+ if (data.message.user) {
335
+ var participant = this.participantByUserId(data.message.user);
336
+ if (participant) {
337
+ participant.isVideoBlockedByAdmin = true;
338
+ if ((participant === null || participant === void 0 ? void 0 : participant.userId) === ((_a = this.meetingStartRequest) === null || _a === void 0 ? void 0 : _a.userId)) {
339
+ (_b = this.meetingHandler) === null || _b === void 0 ? void 0 : _b.pauseCamera((_c = this.meetingStartRequest) === null || _c === void 0 ? void 0 : _c.userId);
340
+ }
341
+ this.emitMessageToSource(VaniEvent.OnVideoBlocked, participant);
342
+ }
343
+ }
315
344
  };
316
345
  CommunicationHandler.prototype.onVideoUnblocked = function (data) {
317
346
  log.info(data);
347
+ if (data.message.user) {
348
+ var participant = this.participantByUserId(data.message.user);
349
+ if (participant) {
350
+ participant.isVideoBlockedByAdmin = false;
351
+ this.emitMessageToSource(VaniEvent.OnVideoUnblocked, participant);
352
+ }
353
+ }
318
354
  };
319
355
  //Connection Recheck
320
356
  CommunicationHandler.prototype.onIceCandidateDisconnected = function () {
@@ -19,6 +19,10 @@ export declare enum VaniEvent {
19
19
  OnAllParticipants = "participants",
20
20
  OnParticipantDataUpdated = "onParticipantDataUpdated",
21
21
  OnAudioVideoStatusUpdated = "audioVideoStatusUpdated",
22
+ OnAudioBlocked = "onAudioBlocked",
23
+ OnVideoBlocked = "videoBlocked",
24
+ OnAudioUnblocked = "audioUnblocked",
25
+ OnVideoUnblocked = "videoUnblocked",
22
26
  OnNewChatMessageReceived = "onNewChatMessageReceived",
23
27
  OnOldMessages = "onOldMessages",
24
28
  OnSpeakerChanged = "onSpeakerChanged",
@@ -50,6 +54,10 @@ interface VaniConnectionEvents {
50
54
  [VaniEvent.OnNotReachable]: () => any;
51
55
  [VaniEvent.OnReconectionTimeout]: () => any;
52
56
  [VaniEvent.OnReconecting]: () => any;
57
+ [VaniEvent.OnVideoUnblocked]: (participant: Participant) => any;
58
+ [VaniEvent.OnAudioUnblocked]: (participant: Participant) => any;
59
+ [VaniEvent.OnVideoBlocked]: (participant: Participant) => any;
60
+ [VaniEvent.OnAudioBlocked]: (participant: Participant) => any;
53
61
  }
54
62
  export declare interface VaniEventListener {
55
63
  on<U extends keyof VaniConnectionEvents>(event: U, listener: VaniConnectionEvents[U]): this;
@@ -17,6 +17,10 @@ export var VaniEvent;
17
17
  VaniEvent["OnAllParticipants"] = "participants";
18
18
  VaniEvent["OnParticipantDataUpdated"] = "onParticipantDataUpdated";
19
19
  VaniEvent["OnAudioVideoStatusUpdated"] = "audioVideoStatusUpdated";
20
+ VaniEvent["OnAudioBlocked"] = "onAudioBlocked";
21
+ VaniEvent["OnVideoBlocked"] = "videoBlocked";
22
+ VaniEvent["OnAudioUnblocked"] = "audioUnblocked";
23
+ VaniEvent["OnVideoUnblocked"] = "videoUnblocked";
20
24
  VaniEvent["OnNewChatMessageReceived"] = "onNewChatMessageReceived";
21
25
  VaniEvent["OnOldMessages"] = "onOldMessages";
22
26
  VaniEvent["OnSpeakerChanged"] = "onSpeakerChanged";
@@ -438,7 +438,6 @@ var WebsocketHandler = /** @class */ (function (_super) {
438
438
  WebsocketHandler.prototype.checkIfPingIsRunning = function () {
439
439
  var _this = this;
440
440
  var _a, _b;
441
- console.log("checkIfPingIsRunning");
442
441
  if (this.isWebScoketConnected()) {
443
442
  if ((this.lastPingTimeStamp + (40 * 1000)) < new Date().getTime()) {
444
443
  this.pingCheckTimeout = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "0.2.4",
3
+ "version": "0.2.7",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",