vani-meeting-client 1.5.5 → 1.5.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.
@@ -12,6 +12,7 @@ export declare class MeetingHandler {
12
12
  private userMediaHandler?;
13
13
  meetingStartRequestObject(roomId: string, userId: string, appId: string, wssUrl: string): MeetingStartRequest;
14
14
  endAndDestory(): void;
15
+ requestToCloseTheRoom: () => void;
15
16
  init(): Promise<void>;
16
17
  switchCamera(): void;
17
18
  startLocalStream(isVideoRequired: boolean, isAudioRequired: boolean, shouldAddTrackImmediately?: boolean, userMediaPayload?: any): Promise<void>;
@@ -44,7 +44,12 @@ import { UserMediaHandler } from "./user-media-handler/UserMediaHandler";
44
44
  // import googleAnalytics from '@analytics/google-analytics'
45
45
  var MeetingHandler = /** @class */ (function () {
46
46
  function MeetingHandler() {
47
+ var _this = this;
47
48
  this.communicationHandler = new CommunicationHandler(this);
49
+ this.requestToCloseTheRoom = function () {
50
+ var _a;
51
+ (_a = _this.communicationHandler) === null || _a === void 0 ? void 0 : _a.requestToCloseTheRoom();
52
+ };
48
53
  }
49
54
  MeetingHandler.prototype.meetingStartRequestObject = function (roomId, userId, appId, wssUrl) {
50
55
  if (!this.meetingStartRequest) {
@@ -46,6 +46,7 @@ export declare class CommunicationHandler {
46
46
  addUpdateRemoteTrack(track: Track, participant: Participant, shouldInfromIfNotExist?: boolean): Track;
47
47
  addUpdateLocalTrack(track: Track): void;
48
48
  onOldMessages(data: any): void;
49
+ requestToCloseTheRoom: () => Promise<void>;
49
50
  onMessage(message: any, shouldInfromSource?: boolean): MessagePayload;
50
51
  sendWebSocketMessage(type: WebSocketEvents, data: any): void;
51
52
  onVideoCallWebSocketMessage(websocketMessage: WebSocketMessageBody): Promise<void>;
@@ -55,6 +56,7 @@ export declare class CommunicationHandler {
55
56
  onAudioUnblocked(data: any): void;
56
57
  onVideoBlocked(data: any): void;
57
58
  onVideoUnblocked(data: any): void;
59
+ destoryRoomForcefully: () => void;
58
60
  onIceCandidateDisconnected(): void;
59
61
  checkIfInternetReachable: (count: number) => void;
60
62
  private onApiResponded;
@@ -50,6 +50,18 @@ var CommunicationHandler = /** @class */ (function () {
50
50
  this.selfTracks = [];
51
51
  this.allTracks = [];
52
52
  this.isReachable = true;
53
+ this.requestToCloseTheRoom = function () { return __awaiter(_this, void 0, void 0, function () {
54
+ var _a;
55
+ return __generator(this, function (_b) {
56
+ (_a = this.websocketCallHandler) === null || _a === void 0 ? void 0 : _a.sendSocketMessage(WebSocketBasicEvents.CloseRoomForceFully, {});
57
+ return [2 /*return*/];
58
+ });
59
+ }); };
60
+ //Connection Recheck
61
+ this.destoryRoomForcefully = function () {
62
+ var _a;
63
+ (_a = _this.meetingHandler) === null || _a === void 0 ? void 0 : _a.endAndDestory();
64
+ };
53
65
  this.checkIfInternetReachable = function (count) {
54
66
  var _a;
55
67
  console.log("checkIfInternetReachable pre", _this.meetingStartRequest);
@@ -458,7 +470,6 @@ var CommunicationHandler = /** @class */ (function () {
458
470
  }
459
471
  }
460
472
  };
461
- //Connection Recheck
462
473
  CommunicationHandler.prototype.onIceCandidateDisconnected = function () {
463
474
  console.log("onIceCandidateDisconnected", this.internetReachbilityTimeout);
464
475
  if (this.internetReachbilityTimeout) {
@@ -7,6 +7,7 @@ export declare enum VaniEvent {
7
7
  OnSocketConnected = "onConnected",
8
8
  OnSocketReconnectTimeOut = "onReconnectTimeOut",
9
9
  OnSocketDisconnected = "onSocketDisconnected",
10
+ OnAskedToCloseTheRoom = "OnAskedToCloseTheRoom",
10
11
  OnConnected = "onConnected",
11
12
  OnConnectionBack = "connectionBack",
12
13
  OnMeetingStartTime = "meetingStartTime",
@@ -5,6 +5,7 @@ export var VaniEvent;
5
5
  VaniEvent["OnSocketConnected"] = "onConnected";
6
6
  VaniEvent["OnSocketReconnectTimeOut"] = "onReconnectTimeOut";
7
7
  VaniEvent["OnSocketDisconnected"] = "onSocketDisconnected";
8
+ VaniEvent["OnAskedToCloseTheRoom"] = "OnAskedToCloseTheRoom";
8
9
  VaniEvent["OnConnected"] = "onConnected";
9
10
  VaniEvent["OnConnectionBack"] = "connectionBack";
10
11
  VaniEvent["OnMeetingStartTime"] = "meetingStartTime";
@@ -5,6 +5,7 @@ export declare enum WebSocketBasicEvents {
5
5
  IsSetupDone = "setupDone",
6
6
  Ping = "ping",
7
7
  Pong = "pong",
8
+ CloseRoomForceFully = "CloseRoomForceFully",
8
9
  AudioVideoPauseResume = "audioVideoPauseResume",
9
10
  OnStartMeetingCalled = "startMeetingCalled",
10
11
  OnAudioVideoPauseResume = "audioVideoPauseResume",
@@ -91,6 +92,7 @@ export declare class WebsocketHandler extends Base {
91
92
  private socketSubscribeToTopic;
92
93
  private askIfSetupDone;
93
94
  private onMessage;
95
+ onCloseTheRoomForcefully: (data: any) => Promise<void>;
94
96
  private onSetupDone;
95
97
  private checkIfPingIsRunning;
96
98
  private isVideoCallControllerMessageType;
@@ -60,6 +60,7 @@ export var WebSocketBasicEvents;
60
60
  WebSocketBasicEvents["IsSetupDone"] = "setupDone";
61
61
  WebSocketBasicEvents["Ping"] = "ping";
62
62
  WebSocketBasicEvents["Pong"] = "pong";
63
+ WebSocketBasicEvents["CloseRoomForceFully"] = "CloseRoomForceFully";
63
64
  WebSocketBasicEvents["AudioVideoPauseResume"] = "audioVideoPauseResume";
64
65
  WebSocketBasicEvents["OnStartMeetingCalled"] = "startMeetingCalled";
65
66
  WebSocketBasicEvents["OnAudioVideoPauseResume"] = "audioVideoPauseResume";
@@ -133,6 +134,18 @@ var WebsocketHandler = /** @class */ (function (_super) {
133
134
  _this.setUpTry = 0;
134
135
  _this.pongData = undefined;
135
136
  _this.lastPingTimeStamp = 0;
137
+ _this.onCloseTheRoomForcefully = function (data) { return __awaiter(_this, void 0, void 0, function () {
138
+ var _a, _b;
139
+ return __generator(this, function (_c) {
140
+ switch (_c.label) {
141
+ case 0: return [4 /*yield*/, ((_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.emitMessageToSource(VaniEvent.OnAskedToCloseTheRoom, {}))];
142
+ case 1:
143
+ _c.sent();
144
+ (_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.destoryRoomForcefully();
145
+ return [2 /*return*/];
146
+ }
147
+ });
148
+ }); };
136
149
  return _this;
137
150
  }
138
151
  WebsocketHandler.prototype.onObjectCreated = function () {
@@ -398,6 +411,9 @@ var WebsocketHandler = /** @class */ (function (_super) {
398
411
  else if (type === WebSocketBasicEvents.IsSetupDone) {
399
412
  this.onSetupDone(data);
400
413
  }
414
+ else if (type === WebSocketBasicEvents.CloseRoomForceFully) {
415
+ this.onCloseTheRoomForcefully(data);
416
+ }
401
417
  else if (type === WebSocketBasicEvents.OnUserOnFoundWhileReconnect) {
402
418
  (_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.emitMessageToSource(VaniEvent.OnUserOnFoundWhileReconnect, {});
403
419
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",