vani-meeting-client 0.8.3 → 0.8.5
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
|
@@ -29,7 +29,8 @@ export declare enum VaniEvent {
|
|
|
29
29
|
OnSpeakerChanged = "onSpeakerChanged",
|
|
30
30
|
OnNotReachable = "notReachable",
|
|
31
31
|
OnReconectionTimeout = "reconectionTimeout",
|
|
32
|
-
OnReconecting = "reconecting"
|
|
32
|
+
OnReconecting = "reconecting",
|
|
33
|
+
OnUserOnFoundWhileReconnect = "onUserOnFoundWhileReconnect"
|
|
33
34
|
}
|
|
34
35
|
interface VaniConnectionEvents {
|
|
35
36
|
[VaniEvent.OnInitDone]: () => any;
|
|
@@ -55,6 +56,7 @@ interface VaniConnectionEvents {
|
|
|
55
56
|
[VaniEvent.OnNotReachable]: () => any;
|
|
56
57
|
[VaniEvent.OnReconectionTimeout]: () => any;
|
|
57
58
|
[VaniEvent.OnReconecting]: () => any;
|
|
59
|
+
[VaniEvent.OnUserOnFoundWhileReconnect]: () => any;
|
|
58
60
|
[VaniEvent.OnVideoUnblocked]: (participant: Participant) => any;
|
|
59
61
|
[VaniEvent.OnAudioUnblocked]: (participant: Participant) => any;
|
|
60
62
|
[VaniEvent.OnVideoBlocked]: (participant: Participant) => any;
|
package/lib/model/Event.js
CHANGED
|
@@ -28,4 +28,5 @@ export var VaniEvent;
|
|
|
28
28
|
VaniEvent["OnNotReachable"] = "notReachable";
|
|
29
29
|
VaniEvent["OnReconectionTimeout"] = "reconectionTimeout";
|
|
30
30
|
VaniEvent["OnReconecting"] = "reconecting";
|
|
31
|
+
VaniEvent["OnUserOnFoundWhileReconnect"] = "onUserOnFoundWhileReconnect";
|
|
31
32
|
})(VaniEvent || (VaniEvent = {}));
|
|
@@ -187,7 +187,12 @@ var UserMediaHandler = /** @class */ (function (_super) {
|
|
|
187
187
|
return permissionDict;
|
|
188
188
|
};
|
|
189
189
|
UserMediaHandler.prototype.getAudioDictionay = function () {
|
|
190
|
-
var permissionDict = {
|
|
190
|
+
var permissionDict = {
|
|
191
|
+
echoCancellation: true, noiseSuppression: true, autoGainControl: true, latency: 0.001, googAutoGainControl: false,
|
|
192
|
+
googNoiseSuppression: true,
|
|
193
|
+
googEchoCancellation: true,
|
|
194
|
+
googHighpassFilter: true
|
|
195
|
+
};
|
|
191
196
|
return permissionDict;
|
|
192
197
|
};
|
|
193
198
|
UserMediaHandler.prototype.startCapturingStream = function (isVideoRequired, isAudioRequired, shouldAddTrackImmediately, userMediaPayload) {
|
|
@@ -16,6 +16,8 @@ export declare enum WebSocketBasicEvents {
|
|
|
16
16
|
UpdateParticipant = "updateParticipant",
|
|
17
17
|
OnParticipantUpdated = "participantUpdated",
|
|
18
18
|
OnNewJoinee = "newJoinee",
|
|
19
|
+
OnUserOnFoundWhileReconnect = "onUserOnFoundWhileReconnect",
|
|
20
|
+
OnRejoined = "OnRejoined",
|
|
19
21
|
OnUserLeft = "userLeft",
|
|
20
22
|
GetAllParticipant = "getParticipant",
|
|
21
23
|
OnServerParticipants = "participants",
|
|
@@ -71,6 +71,8 @@ export var WebSocketBasicEvents;
|
|
|
71
71
|
WebSocketBasicEvents["UpdateParticipant"] = "updateParticipant";
|
|
72
72
|
WebSocketBasicEvents["OnParticipantUpdated"] = "participantUpdated";
|
|
73
73
|
WebSocketBasicEvents["OnNewJoinee"] = "newJoinee";
|
|
74
|
+
WebSocketBasicEvents["OnUserOnFoundWhileReconnect"] = "onUserOnFoundWhileReconnect";
|
|
75
|
+
WebSocketBasicEvents["OnRejoined"] = "OnRejoined";
|
|
74
76
|
WebSocketBasicEvents["OnUserLeft"] = "userLeft";
|
|
75
77
|
WebSocketBasicEvents["GetAllParticipant"] = "getParticipant";
|
|
76
78
|
WebSocketBasicEvents["OnServerParticipants"] = "participants";
|
|
@@ -371,7 +373,7 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
371
373
|
}, 200);
|
|
372
374
|
};
|
|
373
375
|
WebsocketHandler.prototype.onMessage = function (message) {
|
|
374
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
376
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
375
377
|
this.lastPingTimeStamp = new Date().getTime();
|
|
376
378
|
var messagejson = JSON.parse(message);
|
|
377
379
|
if (messagejson.type && messagejson.data) {
|
|
@@ -387,29 +389,32 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
387
389
|
else if (type === WebSocketBasicEvents.IsSetupDone) {
|
|
388
390
|
this.onSetupDone(data);
|
|
389
391
|
}
|
|
390
|
-
else if (type === WebSocketBasicEvents.
|
|
392
|
+
else if (type === WebSocketBasicEvents.OnUserOnFoundWhileReconnect) {
|
|
393
|
+
(_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.emitMessageToSource(VaniEvent.OnUserOnFoundWhileReconnect, {});
|
|
394
|
+
}
|
|
395
|
+
else if (type === WebSocketBasicEvents.OnNewJoinee || type === WebSocketBasicEvents.OnRejoined) {
|
|
391
396
|
if (data && data.message && data.message.participant) {
|
|
392
397
|
console.log("OnParticipantUpdated from server", data.message.participant);
|
|
393
|
-
(
|
|
398
|
+
(_c = this.communicationHandler) === null || _c === void 0 ? void 0 : _c.addParticipantIfNotExist(data.message.participant, true);
|
|
394
399
|
}
|
|
395
400
|
}
|
|
396
401
|
else if (type === WebSocketBasicEvents.OnParticipantUpdated) {
|
|
397
402
|
if (data) {
|
|
398
|
-
(
|
|
403
|
+
(_d = this.communicationHandler) === null || _d === void 0 ? void 0 : _d.addParticipantIfNotExist(data, true);
|
|
399
404
|
}
|
|
400
405
|
}
|
|
401
406
|
else if (type === WebSocketBasicEvents.OnUserLeft) {
|
|
402
|
-
(
|
|
407
|
+
(_e = this.communicationHandler) === null || _e === void 0 ? void 0 : _e.onUserLeft(data);
|
|
403
408
|
}
|
|
404
409
|
else if (type === WebSocketBasicEvents.OnServerParticipants) {
|
|
405
|
-
(
|
|
410
|
+
(_f = this.communicationHandler) === null || _f === void 0 ? void 0 : _f.onServerParticipants(data);
|
|
406
411
|
}
|
|
407
412
|
else if (type === WebSocketBasicEvents.OnOldMessages) {
|
|
408
|
-
(
|
|
413
|
+
(_g = this.communicationHandler) === null || _g === void 0 ? void 0 : _g.onOldMessages(data);
|
|
409
414
|
}
|
|
410
415
|
else if (type === WebSocketBasicEvents.OnChat) {
|
|
411
416
|
if (data.message) {
|
|
412
|
-
(
|
|
417
|
+
(_h = this.communicationHandler) === null || _h === void 0 ? void 0 : _h.onMessage(data.message);
|
|
413
418
|
}
|
|
414
419
|
}
|
|
415
420
|
else if (type === WebSocketBasicEvents.OnMeetingStartTime) {
|
|
@@ -418,23 +423,23 @@ var WebsocketHandler = /** @class */ (function (_super) {
|
|
|
418
423
|
if (time > new Date().getTime()) {
|
|
419
424
|
time = new Date().getTime();
|
|
420
425
|
}
|
|
421
|
-
(
|
|
426
|
+
(_j = this.communicationHandler) === null || _j === void 0 ? void 0 : _j.emitMessageToSource(VaniEvent.OnMeetingStartTime, (time + ""));
|
|
422
427
|
}
|
|
423
428
|
}
|
|
424
429
|
else if (type === WebSocketBasicEvents.OnAudioVideoStatusUpdated) {
|
|
425
|
-
(
|
|
430
|
+
(_k = this.communicationHandler) === null || _k === void 0 ? void 0 : _k.onAudioVideoStatusUpdated(data);
|
|
426
431
|
}
|
|
427
432
|
else if (type === WebSocketBasicEvents.OnAudioBlockRequest) {
|
|
428
|
-
(
|
|
433
|
+
(_l = this.communicationHandler) === null || _l === void 0 ? void 0 : _l.onAudioBlocked(data);
|
|
429
434
|
}
|
|
430
435
|
else if (type === WebSocketBasicEvents.OnAudioUnblockRequest) {
|
|
431
|
-
(
|
|
436
|
+
(_m = this.communicationHandler) === null || _m === void 0 ? void 0 : _m.onAudioUnblocked(data);
|
|
432
437
|
}
|
|
433
438
|
else if (type === WebSocketBasicEvents.OnVideoBlockRequest) {
|
|
434
|
-
(
|
|
439
|
+
(_o = this.communicationHandler) === null || _o === void 0 ? void 0 : _o.onVideoBlocked(data);
|
|
435
440
|
}
|
|
436
441
|
else if (type === WebSocketBasicEvents.OnVideoUnblockRequest) {
|
|
437
|
-
(
|
|
442
|
+
(_p = this.communicationHandler) === null || _p === void 0 ? void 0 : _p.onVideoUnblocked(data);
|
|
438
443
|
}
|
|
439
444
|
}
|
|
440
445
|
};
|