vani-meeting-client 0.2.4 → 0.2.5

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.
@@ -305,16 +305,48 @@ 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
+ }
315
+ if ((participant === null || participant === void 0 ? void 0 : participant.userId) === ((_a = this.meetingStartRequest) === null || _a === void 0 ? void 0 : _a.userId)) {
316
+ (_b = this.meetingHandler) === null || _b === void 0 ? void 0 : _b.muteUser((_c = this.meetingStartRequest) === null || _c === void 0 ? void 0 : _c.userId);
317
+ }
318
+ }
309
319
  };
310
320
  CommunicationHandler.prototype.onAudioUnblocked = function (data) {
311
321
  log.info(data);
322
+ if (data.message.user) {
323
+ var participant = this.participantByUserId(data.message.user);
324
+ if (participant) {
325
+ participant.isAudioBlockedByAdmin = false;
326
+ }
327
+ }
312
328
  };
313
329
  CommunicationHandler.prototype.onVideoBlocked = function (data) {
330
+ var _a, _b, _c;
314
331
  log.info(data);
332
+ if (data.message.user) {
333
+ var participant = this.participantByUserId(data.message.user);
334
+ if (participant) {
335
+ participant.isVideoBlockedByAdmin = true;
336
+ }
337
+ if ((participant === null || participant === void 0 ? void 0 : participant.userId) === ((_a = this.meetingStartRequest) === null || _a === void 0 ? void 0 : _a.userId)) {
338
+ (_b = this.meetingHandler) === null || _b === void 0 ? void 0 : _b.pauseCamera((_c = this.meetingStartRequest) === null || _c === void 0 ? void 0 : _c.userId);
339
+ }
340
+ }
315
341
  };
316
342
  CommunicationHandler.prototype.onVideoUnblocked = function (data) {
317
343
  log.info(data);
344
+ if (data.message.user) {
345
+ var participant = this.participantByUserId(data.message.user);
346
+ if (participant) {
347
+ participant.isVideoBlockedByAdmin = false;
348
+ }
349
+ }
318
350
  };
319
351
  //Connection Recheck
320
352
  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.5",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",