vani-meeting-client 2.2.2 → 2.2.3-beta
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/MeetingHandler.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare class MeetingHandler {
|
|
|
15
15
|
meetingStartRequestObject(roomId: string, userId: string, appId: string, wssUrl: string, shouldIgnoreCaseForRoomId?: boolean): MeetingStartRequest;
|
|
16
16
|
endAndDestory(): void;
|
|
17
17
|
cleanupWebsocket: () => void;
|
|
18
|
+
isWebSocketInPreConnect: () => boolean;
|
|
18
19
|
requestToCloseTheRoom: () => void;
|
|
19
20
|
preconnect: (url: string) => Promise<void>;
|
|
20
21
|
init(): Promise<boolean>;
|
package/lib/MeetingHandler.js
CHANGED
|
@@ -55,6 +55,13 @@ var MeetingHandler = /** @class */ (function () {
|
|
|
55
55
|
catch (err) {
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
+
this.isWebSocketInPreConnect = function () {
|
|
59
|
+
var _a;
|
|
60
|
+
if (_this.websocketCallHandler) {
|
|
61
|
+
return (_a = _this.websocketCallHandler) === null || _a === void 0 ? void 0 : _a.isWebSocketInPreConnect();
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
};
|
|
58
65
|
this.requestToCloseTheRoom = function () {
|
|
59
66
|
var _a;
|
|
60
67
|
(_a = _this.communicationHandler) === null || _a === void 0 ? void 0 : _a.requestToCloseTheRoom();
|
|
@@ -69,16 +69,17 @@ var WebrtcHandler = /** @class */ (function (_super) {
|
|
|
69
69
|
return _this;
|
|
70
70
|
}
|
|
71
71
|
WebrtcHandler.prototype.onParticipantUpdated = function () {
|
|
72
|
-
|
|
72
|
+
console.log("onParticipantUpdated");
|
|
73
|
+
// throw new Error("Method not implemented.");
|
|
73
74
|
};
|
|
74
75
|
WebrtcHandler.prototype.resumeIncomingTrack = function (track) {
|
|
75
|
-
throw new Error("Method not implemented.");
|
|
76
|
+
// throw new Error("Method not implemented.");
|
|
76
77
|
};
|
|
77
78
|
WebrtcHandler.prototype.pauseIncomingTrack = function (track) {
|
|
78
|
-
throw new Error("Method not implemented.");
|
|
79
|
+
// throw new Error("Method not implemented.");
|
|
79
80
|
};
|
|
80
81
|
WebrtcHandler.prototype.onSocketMessage = function (websocketCallHandler) {
|
|
81
|
-
throw new Error("Method not implemented.");
|
|
82
|
+
// throw new Error("Method not implemented.");
|
|
82
83
|
};
|
|
83
84
|
WebrtcHandler.prototype.onAllParticipants = function (participants) {
|
|
84
85
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -99,6 +100,7 @@ var WebrtcHandler = /** @class */ (function (_super) {
|
|
|
99
100
|
case 0:
|
|
100
101
|
selfParticpant = this.communicationHandler.getSelfParticipant();
|
|
101
102
|
if (!(selfParticpant.userId !== participant.userId && !selfParticpant.peerConnections.has(participant.userId))) return [3 /*break*/, 2];
|
|
103
|
+
console.log("onUserJoined ", participant);
|
|
102
104
|
isOfferInitParticipant = this.isOfferInitParticipant(participant);
|
|
103
105
|
if (!!isOfferInitParticipant) return [3 /*break*/, 2];
|
|
104
106
|
if (!selfParticpant.peerConnections.has(participant.userId)) {
|
|
@@ -92,10 +92,12 @@ export declare class WebsocketHandler extends Base {
|
|
|
92
92
|
private setUpTry;
|
|
93
93
|
private pongData;
|
|
94
94
|
private lastPingTimeStamp;
|
|
95
|
+
private isNormalConnectionCalledWhileInPreconnectProcess;
|
|
95
96
|
protected onObjectCreated(): void;
|
|
96
97
|
cleanup(): Promise<void>;
|
|
97
98
|
startSocketConnection(isForPreConnect?: boolean, url?: string): Promise<void>;
|
|
98
99
|
private connect;
|
|
100
|
+
isWebSocketInPreConnect(): boolean;
|
|
99
101
|
isWebScoketConnectedWithoutSetup(): boolean;
|
|
100
102
|
isWebScoketConnected(): boolean;
|
|
101
103
|
sendSocketMessage(type: WebSocketEvents, data: any): void;
|
|
@@ -147,6 +147,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
147
147
|
_this.setUpTry = 0;
|
|
148
148
|
_this.pongData = undefined;
|
|
149
149
|
_this.lastPingTimeStamp = 0;
|
|
150
|
+
_this.isNormalConnectionCalledWhileInPreconnectProcess = false;
|
|
150
151
|
_this.onCloseTheRoomForcefully = function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
151
152
|
var _a, _b;
|
|
152
153
|
return __generator(this, function (_c) {
|
|
@@ -177,6 +178,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
177
178
|
}
|
|
178
179
|
catch (err) {
|
|
179
180
|
}
|
|
181
|
+
this.isNormalConnectionCalledWhileInPreconnectProcess = false;
|
|
180
182
|
this.loadBalancerIpAddressForWebSocket = undefined;
|
|
181
183
|
this.isEnded = true;
|
|
182
184
|
if (this.wss) {
|
|
@@ -248,6 +250,9 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
248
250
|
var _this = this;
|
|
249
251
|
return __generator(this, function (_d) {
|
|
250
252
|
if (this.isEnded === true || this.isWebSocketConnectionInProgress) {
|
|
253
|
+
if (!isForPreConnect) {
|
|
254
|
+
this.isNormalConnectionCalledWhileInPreconnectProcess = true;
|
|
255
|
+
}
|
|
251
256
|
return [2 /*return*/];
|
|
252
257
|
}
|
|
253
258
|
if (!this.wss || (isForceFully && this.isWebScoketConnectedWithoutSetup() === false)) {
|
|
@@ -290,9 +295,13 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
290
295
|
_this.isSetUpDone = false;
|
|
291
296
|
_this.websocketConnectionUrl = url_1;
|
|
292
297
|
_this.socketCheckTimeout = undefined;
|
|
293
|
-
if (!isForPreConnect) {
|
|
298
|
+
if (!isForPreConnect || _this.isNormalConnectionCalledWhileInPreconnectProcess) {
|
|
294
299
|
_this.onSocketConnected();
|
|
295
300
|
}
|
|
301
|
+
else {
|
|
302
|
+
console.log("WebSocket connected in pre connect");
|
|
303
|
+
}
|
|
304
|
+
_this.isNormalConnectionCalledWhileInPreconnectProcess = false;
|
|
296
305
|
};
|
|
297
306
|
this.wss.onmessage = function (event) {
|
|
298
307
|
_this.isWebSocketConnectionInProgress = false;
|
|
@@ -332,6 +341,12 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
332
341
|
});
|
|
333
342
|
});
|
|
334
343
|
};
|
|
344
|
+
WebsocketHandler.prototype.isWebSocketInPreConnect = function () {
|
|
345
|
+
if (this.wss && this.wss.readyState === 1 && !this.isSetUpDone) {
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
return false;
|
|
349
|
+
};
|
|
335
350
|
WebsocketHandler.prototype.isWebScoketConnectedWithoutSetup = function () {
|
|
336
351
|
var _a;
|
|
337
352
|
if (this.wss && this.wss.readyState === 1) {
|
package/package.json
CHANGED
package/lib/.DS_Store
DELETED
|
Binary file
|