vani-meeting-client 2.2.1 → 2.2.2
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.
- package/lib/.DS_Store +0 -0
- package/lib/MeetingHandler.js +10 -1
- package/lib/base/Base.d.ts +1 -0
- package/lib/base/Base.js +4 -0
- package/lib/websocket-handler/WebsocketHandler.js +12 -3
- package/package.json +1 -1
package/lib/.DS_Store
ADDED
|
Binary file
|
package/lib/MeetingHandler.js
CHANGED
|
@@ -158,11 +158,19 @@ var MeetingHandler = /** @class */ (function () {
|
|
|
158
158
|
return [4 /*yield*/, new DynamicLibHelper().getVideoCallClassHandler((_c = this.meetingStartRequest) === null || _c === void 0 ? void 0 : _c.meetingType, this.meetingStartRequest, this.communicationHandler)];
|
|
159
159
|
case 3:
|
|
160
160
|
_e.videoCallHandler = _f.sent();
|
|
161
|
-
|
|
161
|
+
return [3 /*break*/, 5];
|
|
162
162
|
case 4:
|
|
163
|
+
if (this.meetingStartRequest) {
|
|
164
|
+
this.videoCallHandler.setMeetingRequest(this.meetingStartRequest);
|
|
165
|
+
}
|
|
166
|
+
_f.label = 5;
|
|
167
|
+
case 5:
|
|
163
168
|
if (!this.websocketCallHandler) {
|
|
164
169
|
this.websocketCallHandler = new WebsocketHandler(this.meetingStartRequest, this.communicationHandler);
|
|
165
170
|
}
|
|
171
|
+
else if (this.meetingStartRequest) {
|
|
172
|
+
this.websocketCallHandler.setMeetingRequest(this.meetingStartRequest);
|
|
173
|
+
}
|
|
166
174
|
// this.handleGA();
|
|
167
175
|
this.emitMessageToSource(VaniEvent.OnInitDone, {});
|
|
168
176
|
return [2 /*return*/, true];
|
|
@@ -468,6 +476,7 @@ var MeetingHandler = /** @class */ (function () {
|
|
|
468
476
|
MeetingHandler.prototype.checkSocket = function () {
|
|
469
477
|
return __awaiter(this, void 0, void 0, function () {
|
|
470
478
|
return __generator(this, function (_a) {
|
|
479
|
+
debugger;
|
|
471
480
|
if (!this.meetingStartRequest) {
|
|
472
481
|
log.error("meetingStartRequestObject not found");
|
|
473
482
|
return [2 /*return*/, false];
|
package/lib/base/Base.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare abstract class Base {
|
|
|
4
4
|
protected meetingStartRequest?: MeetingStartRequest;
|
|
5
5
|
protected communicationHandler?: CommunicationHandler;
|
|
6
6
|
constructor(_meetingStartRequest: MeetingStartRequest, _communicationHandler: CommunicationHandler);
|
|
7
|
+
setMeetingRequest: (_meetingStartRequest: MeetingStartRequest) => void;
|
|
7
8
|
protected onObjectCreated(): void;
|
|
8
9
|
cleanup(): void;
|
|
9
10
|
}
|
package/lib/base/Base.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
var Base = /** @class */ (function () {
|
|
2
2
|
function Base(_meetingStartRequest, _communicationHandler) {
|
|
3
|
+
var _this = this;
|
|
4
|
+
this.setMeetingRequest = function (_meetingStartRequest) {
|
|
5
|
+
_this.meetingStartRequest = _meetingStartRequest;
|
|
6
|
+
};
|
|
3
7
|
this.meetingStartRequest = _meetingStartRequest;
|
|
4
8
|
this.communicationHandler = _communicationHandler;
|
|
5
9
|
this.onObjectCreated();
|
|
@@ -259,6 +259,12 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
259
259
|
if (!url_1 && ((_a = this.meetingStartRequest) === null || _a === void 0 ? void 0 : _a.wssUrl) && this.meetingStartRequest.wssUrl !== null) {
|
|
260
260
|
url_1 = this.meetingStartRequest.wssUrl;
|
|
261
261
|
}
|
|
262
|
+
if (!url_1 && this.websocketConnectionUrl) {
|
|
263
|
+
url_1 = this.websocketConnectionUrl;
|
|
264
|
+
}
|
|
265
|
+
if (!url_1) {
|
|
266
|
+
return [2 /*return*/];
|
|
267
|
+
}
|
|
262
268
|
if (url_1 !== this.websocketConnectionUrl) {
|
|
263
269
|
if (this.wss) {
|
|
264
270
|
this.wss.close();
|
|
@@ -267,6 +273,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
267
273
|
if (!url_1.includes("connection=")) {
|
|
268
274
|
url_1 = url_1 + "/?connection=";
|
|
269
275
|
}
|
|
276
|
+
debugger;
|
|
270
277
|
if (url_1) {
|
|
271
278
|
this.meetingStartRequest && this.meetingStartRequest.logLevel === LogLevel.Debug && log.info("Connecting to ", url_1);
|
|
272
279
|
this.isWebSocketConnectionInProgress = true;
|
|
@@ -306,6 +313,8 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
306
313
|
}
|
|
307
314
|
};
|
|
308
315
|
this.wss.onclose = function (event) {
|
|
316
|
+
debugger;
|
|
317
|
+
_this.isSetUpDone = false;
|
|
309
318
|
_this.isWebSocketConnectionInProgress = false;
|
|
310
319
|
_this.meetingStartRequest && _this.meetingStartRequest.logLevel === LogLevel.Debug && ("WebSocket is closed now.");
|
|
311
320
|
// log.warn(event)
|
|
@@ -316,7 +325,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
316
325
|
else if (isForceFully === false && !isForPreConnect && this.isWebScoketConnected()) {
|
|
317
326
|
(_c = this.communicationHandler) === null || _c === void 0 ? void 0 : _c.emitMessageToSource(VaniEvent.OnSocketConnected, {});
|
|
318
327
|
}
|
|
319
|
-
else if (isForPreConnect && this.isWebScoketConnectedWithoutSetup() && !this.isSetUpDone) {
|
|
328
|
+
else if (!isForPreConnect && this.isWebScoketConnectedWithoutSetup() && !this.isSetUpDone) {
|
|
320
329
|
this.onSocketConnected();
|
|
321
330
|
}
|
|
322
331
|
return [2 /*return*/];
|
|
@@ -341,7 +350,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
341
350
|
};
|
|
342
351
|
WebsocketHandler.prototype.sendSocketMessage = function (type, data) {
|
|
343
352
|
var _a;
|
|
344
|
-
if (this.
|
|
353
|
+
if (this.isWebScoketConnectedWithoutSetup()) {
|
|
345
354
|
var paylod = { type: type, data: data };
|
|
346
355
|
(_a = this.wss) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify(paylod));
|
|
347
356
|
}
|
|
@@ -414,7 +423,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
414
423
|
};
|
|
415
424
|
WebsocketHandler.prototype.socketSubscribeToTopic = function () {
|
|
416
425
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
417
|
-
if (this.
|
|
426
|
+
if (this.isWebScoketConnectedWithoutSetup() === false) {
|
|
418
427
|
return;
|
|
419
428
|
}
|
|
420
429
|
this.communicationHandler.updateSelfParticipantUserId();
|