vani-meeting-client 0.4.9 → 0.5.0
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.
|
@@ -32,6 +32,7 @@ export declare class CommunicationHandler {
|
|
|
32
32
|
addParticipantIfNotExist(participant: Participant, shouldInfrom?: boolean): Participant | undefined;
|
|
33
33
|
removeParticipant(participant: Participant, shouldInfrom?: boolean): void;
|
|
34
34
|
onUserLeft(data: any): void;
|
|
35
|
+
private updateParticipantAudioVideoDataAccordingToTrack;
|
|
35
36
|
getSelfTrackByType(trackKind: TrackKind): Track | undefined;
|
|
36
37
|
getAllSelfTracks(): Track[];
|
|
37
38
|
getAllTracks(): Track[];
|
|
@@ -138,10 +138,12 @@ var CommunicationHandler = /** @class */ (function () {
|
|
|
138
138
|
if (shouldInfrom) {
|
|
139
139
|
this.emitMessageToSource(VaniEvent.OnParticipantDataUpdated, oldParticipant);
|
|
140
140
|
}
|
|
141
|
+
this.updateParticipantAudioVideoDataAccordingToTrack(oldParticipant);
|
|
141
142
|
return oldParticipant;
|
|
142
143
|
}
|
|
143
144
|
else {
|
|
144
145
|
participant = Object.assign(new Participant(participant.userId, participant.roomId, participant.userData, participant.isAdmin), participant);
|
|
146
|
+
this.updateParticipantAudioVideoDataAccordingToTrack(participant);
|
|
145
147
|
this.allParticipants.push(participant);
|
|
146
148
|
if (shouldInfrom) {
|
|
147
149
|
this.emitMessageToSource(VaniEvent.OnUserJoined, participant);
|
|
@@ -174,6 +176,10 @@ var CommunicationHandler = /** @class */ (function () {
|
|
|
174
176
|
}
|
|
175
177
|
}
|
|
176
178
|
};
|
|
179
|
+
CommunicationHandler.prototype.updateParticipantAudioVideoDataAccordingToTrack = function (participant) {
|
|
180
|
+
participant.isAudioEnable = this.getAllTracks().find(function (track) { return track.trackKind === TrackKind.Audio; }) ? true : false;
|
|
181
|
+
participant.isVideoEnable = this.getAllTracks().find(function (track) { return track.trackKind === TrackKind.Video; }) ? true : false;
|
|
182
|
+
};
|
|
177
183
|
CommunicationHandler.prototype.getSelfTrackByType = function (trackKind) {
|
|
178
184
|
return this.selfTracks.find(function (track) { return track.trackKind === trackKind; });
|
|
179
185
|
};
|