vani-meeting-client 1.8.1 → 1.8.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/model/Event.d.ts
CHANGED
|
@@ -32,7 +32,8 @@ export declare enum VaniEvent {
|
|
|
32
32
|
OnNotReachable = "notReachable",
|
|
33
33
|
OnReconectionTimeout = "reconectionTimeout",
|
|
34
34
|
OnReconecting = "reconecting",
|
|
35
|
-
OnUserOnFoundWhileReconnect = "onUserOnFoundWhileReconnect"
|
|
35
|
+
OnUserOnFoundWhileReconnect = "onUserOnFoundWhileReconnect",
|
|
36
|
+
OnNewPingFromServer = "OnNewPingFromServer"
|
|
36
37
|
}
|
|
37
38
|
interface VaniConnectionEvents {
|
|
38
39
|
[VaniEvent.OnInitDone]: () => any;
|
|
@@ -52,6 +53,7 @@ interface VaniConnectionEvents {
|
|
|
52
53
|
[VaniEvent.OnAllParticipants]: (participants: Participant[]) => any;
|
|
53
54
|
[VaniEvent.OnParticipantDataUpdated]: (participants: Participant) => any;
|
|
54
55
|
[VaniEvent.OnMeetingStartTime]: (time: string) => any;
|
|
56
|
+
[VaniEvent.OnNewPingFromServer]: () => any;
|
|
55
57
|
[VaniEvent.OnOldMessages]: (messages: MessagePayload[]) => any;
|
|
56
58
|
[VaniEvent.OnNewChatMessageReceived]: (message: MessagePayload) => any;
|
|
57
59
|
[VaniEvent.OnSpeakerChanged]: (participant: Participant) => any;
|
package/lib/model/Event.js
CHANGED
|
@@ -31,4 +31,5 @@ export var VaniEvent;
|
|
|
31
31
|
VaniEvent["OnReconectionTimeout"] = "reconectionTimeout";
|
|
32
32
|
VaniEvent["OnReconecting"] = "reconecting";
|
|
33
33
|
VaniEvent["OnUserOnFoundWhileReconnect"] = "onUserOnFoundWhileReconnect";
|
|
34
|
+
VaniEvent["OnNewPingFromServer"] = "OnNewPingFromServer";
|
|
34
35
|
})(VaniEvent || (VaniEvent = {}));
|
|
@@ -406,7 +406,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
406
406
|
}, 300);
|
|
407
407
|
};
|
|
408
408
|
WebsocketHandler.prototype.onMessage = function (message) {
|
|
409
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
409
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
410
410
|
this.lastPingTimeStamp = new Date().getTime();
|
|
411
411
|
// this.meetingStartRequest && this.meetingStartRequest.logLevel === LogLevel.Debug && console.log("lastPingTimeStamp time ", this.lastPingTimeStamp)
|
|
412
412
|
var messagejson = JSON.parse(message);
|
|
@@ -416,9 +416,10 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
416
416
|
if (type === WebSocketBasicEvents.Ping) {
|
|
417
417
|
this.pongData = data;
|
|
418
418
|
this.sendSocketMessage(WebSocketBasicEvents.Pong, data);
|
|
419
|
+
(_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.emitMessageToSource(VaniEvent.OnNewPingFromServer, {});
|
|
419
420
|
}
|
|
420
421
|
else if (this.isVideoCallControllerMessageType(type)) {
|
|
421
|
-
(
|
|
422
|
+
(_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.onVideoCallWebSocketMessage(messagejson);
|
|
422
423
|
return;
|
|
423
424
|
}
|
|
424
425
|
else if (type === WebSocketBasicEvents.IsSetupDone) {
|
|
@@ -428,31 +429,31 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
428
429
|
this.onCloseTheRoomForcefully(data);
|
|
429
430
|
}
|
|
430
431
|
else if (type === WebSocketBasicEvents.OnUserOnFoundWhileReconnect) {
|
|
431
|
-
(
|
|
432
|
+
(_c = this.communicationHandler) === null || _c === void 0 ? void 0 : _c.emitMessageToSource(VaniEvent.OnUserOnFoundWhileReconnect, {});
|
|
432
433
|
}
|
|
433
434
|
else if (type === WebSocketBasicEvents.OnNewJoinee || type === WebSocketBasicEvents.OnRejoined) {
|
|
434
435
|
if (data && data.message && data.message.participant) {
|
|
435
436
|
this.meetingStartRequest && this.meetingStartRequest.logLevel === LogLevel.Debug && console.log("OnParticipantUpdated from server", data.message.participant);
|
|
436
|
-
(
|
|
437
|
+
(_d = this.communicationHandler) === null || _d === void 0 ? void 0 : _d.addParticipantIfNotExist(data.message.participant, true);
|
|
437
438
|
}
|
|
438
439
|
}
|
|
439
440
|
else if (type === WebSocketBasicEvents.OnParticipantUpdated) {
|
|
440
441
|
if (data) {
|
|
441
|
-
(
|
|
442
|
+
(_e = this.communicationHandler) === null || _e === void 0 ? void 0 : _e.addParticipantIfNotExist(data.message, true);
|
|
442
443
|
}
|
|
443
444
|
}
|
|
444
445
|
else if (type === WebSocketBasicEvents.OnUserLeft) {
|
|
445
|
-
(
|
|
446
|
+
(_f = this.communicationHandler) === null || _f === void 0 ? void 0 : _f.onUserLeft(data);
|
|
446
447
|
}
|
|
447
448
|
else if (type === WebSocketBasicEvents.OnServerParticipants) {
|
|
448
|
-
(
|
|
449
|
+
(_g = this.communicationHandler) === null || _g === void 0 ? void 0 : _g.onServerParticipants(data);
|
|
449
450
|
}
|
|
450
451
|
else if (type === WebSocketBasicEvents.OnOldMessages) {
|
|
451
|
-
(
|
|
452
|
+
(_h = this.communicationHandler) === null || _h === void 0 ? void 0 : _h.onOldMessages(data);
|
|
452
453
|
}
|
|
453
454
|
else if (type === WebSocketBasicEvents.OnChat) {
|
|
454
455
|
if (data.message) {
|
|
455
|
-
(
|
|
456
|
+
(_j = this.communicationHandler) === null || _j === void 0 ? void 0 : _j.onMessage(data.message);
|
|
456
457
|
}
|
|
457
458
|
}
|
|
458
459
|
else if (type === WebSocketBasicEvents.OnMeetingStartTime) {
|
|
@@ -461,23 +462,23 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
461
462
|
if (time > new Date().getTime()) {
|
|
462
463
|
time = new Date().getTime();
|
|
463
464
|
}
|
|
464
|
-
(
|
|
465
|
+
(_k = this.communicationHandler) === null || _k === void 0 ? void 0 : _k.emitMessageToSource(VaniEvent.OnMeetingStartTime, (time + ""));
|
|
465
466
|
}
|
|
466
467
|
}
|
|
467
468
|
else if (type === WebSocketBasicEvents.OnAudioVideoStatusUpdated) {
|
|
468
|
-
(
|
|
469
|
+
(_l = this.communicationHandler) === null || _l === void 0 ? void 0 : _l.onAudioVideoStatusUpdated(data);
|
|
469
470
|
}
|
|
470
471
|
else if (type === WebSocketBasicEvents.OnAudioBlockRequest) {
|
|
471
|
-
(
|
|
472
|
+
(_m = this.communicationHandler) === null || _m === void 0 ? void 0 : _m.onAudioBlocked(data);
|
|
472
473
|
}
|
|
473
474
|
else if (type === WebSocketBasicEvents.OnAudioUnblockRequest) {
|
|
474
|
-
(
|
|
475
|
+
(_o = this.communicationHandler) === null || _o === void 0 ? void 0 : _o.onAudioUnblocked(data);
|
|
475
476
|
}
|
|
476
477
|
else if (type === WebSocketBasicEvents.OnVideoBlockRequest) {
|
|
477
|
-
(
|
|
478
|
+
(_p = this.communicationHandler) === null || _p === void 0 ? void 0 : _p.onVideoBlocked(data);
|
|
478
479
|
}
|
|
479
480
|
else if (type === WebSocketBasicEvents.OnVideoUnblockRequest) {
|
|
480
|
-
(
|
|
481
|
+
(_q = this.communicationHandler) === null || _q === void 0 ? void 0 : _q.onVideoUnblocked(data);
|
|
481
482
|
}
|
|
482
483
|
}
|
|
483
484
|
};
|