vani-meeting-client 0.2.1 → 0.2.4
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/inter-communication-handler/CommunicationHandler.d.ts +4 -0
- package/lib/inter-communication-handler/CommunicationHandler.js +12 -0
- package/lib/video-call-handler/SFUHandler.d.ts +1 -0
- package/lib/video-call-handler/SFUHandler.js +13 -0
- package/lib/websocket-handler/WebsocketHandler.d.ts +2 -1
- package/lib/websocket-handler/WebsocketHandler.js +16 -2
- package/package.json +1 -1
|
@@ -47,6 +47,10 @@ export declare class CommunicationHandler {
|
|
|
47
47
|
onVideoCallWebSocketMessage(websocketMessage: WebSocketMessageBody): Promise<void>;
|
|
48
48
|
onReconnect(): Promise<void>;
|
|
49
49
|
onStartMeeingCalled(): void;
|
|
50
|
+
onAudioBlocked(data: any): void;
|
|
51
|
+
onAudioUnblocked(data: any): void;
|
|
52
|
+
onVideoBlocked(data: any): void;
|
|
53
|
+
onVideoUnblocked(data: any): void;
|
|
50
54
|
onIceCandidateDisconnected(): void;
|
|
51
55
|
private checkIfInternetReachable;
|
|
52
56
|
private onApiResponded;
|
|
@@ -304,6 +304,18 @@ var CommunicationHandler = /** @class */ (function () {
|
|
|
304
304
|
}
|
|
305
305
|
(_d = this.videoCallHandler) === null || _d === void 0 ? void 0 : _d.init();
|
|
306
306
|
};
|
|
307
|
+
CommunicationHandler.prototype.onAudioBlocked = function (data) {
|
|
308
|
+
log.info(data);
|
|
309
|
+
};
|
|
310
|
+
CommunicationHandler.prototype.onAudioUnblocked = function (data) {
|
|
311
|
+
log.info(data);
|
|
312
|
+
};
|
|
313
|
+
CommunicationHandler.prototype.onVideoBlocked = function (data) {
|
|
314
|
+
log.info(data);
|
|
315
|
+
};
|
|
316
|
+
CommunicationHandler.prototype.onVideoUnblocked = function (data) {
|
|
317
|
+
log.info(data);
|
|
318
|
+
};
|
|
307
319
|
//Connection Recheck
|
|
308
320
|
CommunicationHandler.prototype.onIceCandidateDisconnected = function () {
|
|
309
321
|
if (this.internetReachbilityTimeout) {
|
|
@@ -20,6 +20,7 @@ export declare class SFUHandler extends BaseVideoCallHandler {
|
|
|
20
20
|
sendTrack(track: Track): Promise<void>;
|
|
21
21
|
onParticipantUpdated(): void;
|
|
22
22
|
init(): Promise<void>;
|
|
23
|
+
private onTransportNotFound;
|
|
23
24
|
private addObserverForDevice;
|
|
24
25
|
private onRouterRtpCapabilities;
|
|
25
26
|
private onTransportConnectDone;
|
|
@@ -228,6 +228,16 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
228
228
|
});
|
|
229
229
|
});
|
|
230
230
|
};
|
|
231
|
+
SFUHandler.prototype.onTransportNotFound = function (data) {
|
|
232
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
233
|
+
var messageJson;
|
|
234
|
+
return __generator(this, function (_a) {
|
|
235
|
+
messageJson = { to: "self", type: SFUMessageType.OnCreateTransports, message: SFUMessageType.OnCreateTransports };
|
|
236
|
+
this.sendSFUMessageToSocket(messageJson);
|
|
237
|
+
return [2 /*return*/];
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
};
|
|
231
241
|
SFUHandler.prototype.addObserverForDevice = function () {
|
|
232
242
|
return __awaiter(this, void 0, void 0, function () {
|
|
233
243
|
var _this = this;
|
|
@@ -368,6 +378,9 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
368
378
|
else if (websocketCallHandler.type === SFUMessageType.OnTrackEnded) {
|
|
369
379
|
this.onTrackEnded(websocketCallHandler.data);
|
|
370
380
|
}
|
|
381
|
+
else if (websocketCallHandler.type === SFUMessageType.OnTransportNotFound) {
|
|
382
|
+
this.onTransportNotFound(websocketCallHandler.data);
|
|
383
|
+
}
|
|
371
384
|
};
|
|
372
385
|
SFUHandler.prototype.onTrackEnded = function (data) {
|
|
373
386
|
var _a, _b;
|
|
@@ -49,7 +49,8 @@ export declare enum SFUMessageType {
|
|
|
49
49
|
OnSpeakerChanged = "onSpeakerChanged",
|
|
50
50
|
OnRestartIceCandidate = "restartIceCandidate",
|
|
51
51
|
OnTrackEnded = "onTrackEnded",
|
|
52
|
-
UpdateSpatialConsumer = "updateSpatialConsumer"
|
|
52
|
+
UpdateSpatialConsumer = "updateSpatialConsumer",
|
|
53
|
+
OnTransportNotFound = "onTransportNotFound"
|
|
53
54
|
}
|
|
54
55
|
export declare type WebSocketEvents = SFUMessageType | WebSocketBasicEvents;
|
|
55
56
|
export interface WebSocketMessageBody {
|
|
@@ -106,6 +106,7 @@ export var SFUMessageType;
|
|
|
106
106
|
SFUMessageType["OnRestartIceCandidate"] = "restartIceCandidate";
|
|
107
107
|
SFUMessageType["OnTrackEnded"] = "onTrackEnded";
|
|
108
108
|
SFUMessageType["UpdateSpatialConsumer"] = "updateSpatialConsumer";
|
|
109
|
+
SFUMessageType["OnTransportNotFound"] = "onTransportNotFound";
|
|
109
110
|
})(SFUMessageType || (SFUMessageType = {}));
|
|
110
111
|
var ConnectionType;
|
|
111
112
|
(function (ConnectionType) {
|
|
@@ -347,7 +348,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
347
348
|
}, 200);
|
|
348
349
|
};
|
|
349
350
|
WebsocketHandler.prototype.onMessage = function (message) {
|
|
350
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
351
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
351
352
|
this.lastPingTimeStamp = new Date().getTime();
|
|
352
353
|
var messagejson = JSON.parse(message);
|
|
353
354
|
if (messagejson.type && messagejson.data) {
|
|
@@ -394,6 +395,18 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
394
395
|
else if (type === WebSocketBasicEvents.OnAudioVideoStatusUpdated) {
|
|
395
396
|
(_h = this.communicationHandler) === null || _h === void 0 ? void 0 : _h.onAudioVideoStatusUpdated(data);
|
|
396
397
|
}
|
|
398
|
+
else if (type === WebSocketBasicEvents.OnAudioBlockRequest) {
|
|
399
|
+
(_j = this.communicationHandler) === null || _j === void 0 ? void 0 : _j.onAudioBlocked(data);
|
|
400
|
+
}
|
|
401
|
+
else if (type === WebSocketBasicEvents.OnAudioUnblockRequest) {
|
|
402
|
+
(_k = this.communicationHandler) === null || _k === void 0 ? void 0 : _k.onAudioUnblocked(data);
|
|
403
|
+
}
|
|
404
|
+
else if (type === WebSocketBasicEvents.OnVideoBlockRequest) {
|
|
405
|
+
(_l = this.communicationHandler) === null || _l === void 0 ? void 0 : _l.onVideoBlocked(data);
|
|
406
|
+
}
|
|
407
|
+
else if (type === WebSocketBasicEvents.OnVideoUnblockRequest) {
|
|
408
|
+
(_m = this.communicationHandler) === null || _m === void 0 ? void 0 : _m.onVideoUnblocked(data);
|
|
409
|
+
}
|
|
397
410
|
}
|
|
398
411
|
};
|
|
399
412
|
WebsocketHandler.prototype.onSetupDone = function (data) {
|
|
@@ -424,13 +437,14 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
424
437
|
};
|
|
425
438
|
WebsocketHandler.prototype.checkIfPingIsRunning = function () {
|
|
426
439
|
var _this = this;
|
|
427
|
-
var _a;
|
|
440
|
+
var _a, _b;
|
|
428
441
|
console.log("checkIfPingIsRunning");
|
|
429
442
|
if (this.isWebScoketConnected()) {
|
|
430
443
|
if ((this.lastPingTimeStamp + (40 * 1000)) < new Date().getTime()) {
|
|
431
444
|
this.pingCheckTimeout = undefined;
|
|
432
445
|
//Discounted
|
|
433
446
|
(_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.onIceCandidateDisconnected();
|
|
447
|
+
(_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.emitMessageToSource(VaniEvent.OnNotReachable, {});
|
|
434
448
|
}
|
|
435
449
|
else {
|
|
436
450
|
this.pingCheckTimeout = window.setTimeout(function () {
|