vani-meeting-client 1.2.8 → 1.2.9
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 +5 -0
- package/lib/model/Event.js +1 -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 +1 -0
- package/package.json +1 -1
package/lib/model/Event.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare enum VaniEvent {
|
|
|
27
27
|
OnNewChatMessageReceived = "onNewChatMessageReceived",
|
|
28
28
|
OnOldMessages = "onOldMessages",
|
|
29
29
|
OnSpeakerChanged = "onSpeakerChanged",
|
|
30
|
+
OnAudioVolumeChanged = "OnAudioVolumeChanged",
|
|
30
31
|
OnNotReachable = "notReachable",
|
|
31
32
|
OnReconectionTimeout = "reconectionTimeout",
|
|
32
33
|
OnReconecting = "reconecting",
|
|
@@ -53,6 +54,10 @@ interface VaniConnectionEvents {
|
|
|
53
54
|
[VaniEvent.OnOldMessages]: (messages: MessagePayload[]) => any;
|
|
54
55
|
[VaniEvent.OnNewChatMessageReceived]: (message: MessagePayload) => any;
|
|
55
56
|
[VaniEvent.OnSpeakerChanged]: (participant: Participant) => any;
|
|
57
|
+
[VaniEvent.OnAudioVolumeChanged]: (data: {
|
|
58
|
+
participant: Participant;
|
|
59
|
+
volume: any;
|
|
60
|
+
}) => any;
|
|
56
61
|
[VaniEvent.OnNotReachable]: () => any;
|
|
57
62
|
[VaniEvent.OnReconectionTimeout]: () => any;
|
|
58
63
|
[VaniEvent.OnReconecting]: () => any;
|
package/lib/model/Event.js
CHANGED
|
@@ -25,6 +25,7 @@ export var VaniEvent;
|
|
|
25
25
|
VaniEvent["OnNewChatMessageReceived"] = "onNewChatMessageReceived";
|
|
26
26
|
VaniEvent["OnOldMessages"] = "onOldMessages";
|
|
27
27
|
VaniEvent["OnSpeakerChanged"] = "onSpeakerChanged";
|
|
28
|
+
VaniEvent["OnAudioVolumeChanged"] = "OnAudioVolumeChanged";
|
|
28
29
|
VaniEvent["OnNotReachable"] = "notReachable";
|
|
29
30
|
VaniEvent["OnReconectionTimeout"] = "reconectionTimeout";
|
|
30
31
|
VaniEvent["OnReconecting"] = "reconecting";
|
|
@@ -548,6 +548,9 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
548
548
|
else if (websocketCallHandler.type === SFUMessageType.OnSpeakerChanged) {
|
|
549
549
|
this.onSpeakerChanged(websocketCallHandler.data);
|
|
550
550
|
}
|
|
551
|
+
else if (websocketCallHandler.type === SFUMessageType.OnAudioVolumeChanged) {
|
|
552
|
+
this.onAudioVolumeChanged(websocketCallHandler.data);
|
|
553
|
+
}
|
|
551
554
|
else if (websocketCallHandler.type === SFUMessageType.OnTrackEnded) {
|
|
552
555
|
this.onTrackEnded(websocketCallHandler.data);
|
|
553
556
|
}
|
|
@@ -655,6 +658,16 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
655
658
|
});
|
|
656
659
|
});
|
|
657
660
|
};
|
|
661
|
+
SFUHandler.prototype.onAudioVolumeChanged = function (data) {
|
|
662
|
+
var _a, _b;
|
|
663
|
+
if (data && data.message && data.message.userId) {
|
|
664
|
+
var speakerId = data.message.userId;
|
|
665
|
+
var participant = (_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.participantByUserId(speakerId);
|
|
666
|
+
if (participant) {
|
|
667
|
+
(_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.emitMessageToSource(VaniEvent.OnAudioVolumeChanged, { participant: participant, volume: data.message.volume });
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
};
|
|
658
671
|
SFUHandler.prototype.onSpeakerChanged = function (data) {
|
|
659
672
|
var _a, _b;
|
|
660
673
|
if (data && data.message && data.message.speakerUserId) {
|
|
@@ -58,7 +58,8 @@ export declare enum SFUMessageType {
|
|
|
58
58
|
OnRestartIceCandidateResponse = "onRestartIceCandidate",
|
|
59
59
|
OnTransportNotFound = "onTransportNotFound",
|
|
60
60
|
GetAllProducers = "getAllProducers",
|
|
61
|
-
OnAllProducers = "onAllProducers"
|
|
61
|
+
OnAllProducers = "onAllProducers",
|
|
62
|
+
OnAudioVolumeChanged = "OnAudioVolumeChanged"
|
|
62
63
|
}
|
|
63
64
|
export type WebSocketEvents = SFUMessageType | WebSocketBasicEvents;
|
|
64
65
|
export interface WebSocketMessageBody {
|
|
@@ -115,6 +115,7 @@ export var SFUMessageType;
|
|
|
115
115
|
SFUMessageType["OnTransportNotFound"] = "onTransportNotFound";
|
|
116
116
|
SFUMessageType["GetAllProducers"] = "getAllProducers";
|
|
117
117
|
SFUMessageType["OnAllProducers"] = "onAllProducers";
|
|
118
|
+
SFUMessageType["OnAudioVolumeChanged"] = "OnAudioVolumeChanged";
|
|
118
119
|
})(SFUMessageType || (SFUMessageType = {}));
|
|
119
120
|
var ConnectionType;
|
|
120
121
|
(function (ConnectionType) {
|