vani-meeting-client-native 0.4.6-beta3 → 0.4.6-beta5
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.
|
@@ -17,6 +17,7 @@ export declare class Participant {
|
|
|
17
17
|
private peerConnections;
|
|
18
18
|
getPeerConnections: () => Map<string, PeerConnection>;
|
|
19
19
|
isPeerConnectionsViaUserIdPresent: (userId: string) => PeerConnection;
|
|
20
|
+
removePeerConnectionsViaUserId: (userId: string) => boolean;
|
|
20
21
|
getPeerConnectionsViaUserId: (userId: string, meetingStartRequest: MeetingStartRequest) => PeerConnection;
|
|
21
22
|
constructor(_userId: string, _roomId: string, _userData?: any, _isAdmin?: boolean);
|
|
22
23
|
}
|
package/lib/model/Participant.js
CHANGED
|
@@ -25,6 +25,9 @@ var Participant = /** @class */ (function () {
|
|
|
25
25
|
this.isPeerConnectionsViaUserIdPresent = function (userId) {
|
|
26
26
|
return _this.getPeerConnections().get(userId);
|
|
27
27
|
};
|
|
28
|
+
this.removePeerConnectionsViaUserId = function (userId) {
|
|
29
|
+
return _this.getPeerConnections().delete(userId);
|
|
30
|
+
};
|
|
28
31
|
this.getPeerConnectionsViaUserId = function (userId, meetingStartRequest) {
|
|
29
32
|
if (!_this.getPeerConnections().has(userId)) {
|
|
30
33
|
var peerConnection = new PeerConnection();
|
|
@@ -42,6 +42,7 @@ export declare class WebrtcHandler extends BaseVideoCallHandler {
|
|
|
42
42
|
subToConnectionState: (remoteParticipant: Participant) => Promise<void>;
|
|
43
43
|
onNegotiationNeeded: (remoteParticipant: Participant, shouldRestartIce?: boolean, count?: number, shouldForceFullyCreateOffer?: boolean) => Promise<void>;
|
|
44
44
|
onAllParticipants(participants: Participant[]): Promise<void>;
|
|
45
|
+
onUserLeft(participant: Participant): Promise<void>;
|
|
45
46
|
onUserJoined(participant: Participant): Promise<void>;
|
|
46
47
|
startSendTrackToPartiipant: (participant: Participant) => Promise<void>;
|
|
47
48
|
sendTrackToParticipant: (track: Track, participant: Participant) => Promise<void>;
|
|
@@ -714,11 +714,12 @@ var WebrtcHandler = /** @class */ (function (_super) {
|
|
|
714
714
|
}); };
|
|
715
715
|
_this.sendTrackToParticipant = function (track, participant) { return __awaiter(_this, void 0, void 0, function () {
|
|
716
716
|
var selfParticpant, peerConnection;
|
|
717
|
-
|
|
717
|
+
var _a;
|
|
718
|
+
return __generator(this, function (_b) {
|
|
718
719
|
if (!track.track) {
|
|
719
720
|
return [2 /*return*/];
|
|
720
721
|
}
|
|
721
|
-
selfParticpant = this.communicationHandler.getSelfParticipant();
|
|
722
|
+
selfParticpant = (_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.getSelfParticipant();
|
|
722
723
|
if (selfParticpant) {
|
|
723
724
|
peerConnection = selfParticpant.getPeerConnectionsViaUserId(participant.userId, this.meetingStartRequest);
|
|
724
725
|
if (peerConnection && peerConnection.rtcPeerConnection && peerConnection.rtcPeerConnection.signalingState === 'stable') {
|
|
@@ -836,13 +837,10 @@ var WebrtcHandler = /** @class */ (function (_super) {
|
|
|
836
837
|
transceiver.sender.setParameters(params).catch(console.error);
|
|
837
838
|
};
|
|
838
839
|
_this.onNewTrack = function (track, receiver, transceiver, remoteParticipant) { return __awaiter(_this, void 0, void 0, function () {
|
|
839
|
-
var kind
|
|
840
|
-
|
|
841
|
-
return __generator(this, function (_b) {
|
|
842
|
-
this.printLogIfRequired('ontrack fired', track.kind, track.id);
|
|
840
|
+
var kind;
|
|
841
|
+
return __generator(this, function (_a) {
|
|
843
842
|
kind = track.kind.toLowerCase() === 'audio' ? TrackKind.Audio : TrackKind.Video;
|
|
844
|
-
|
|
845
|
-
(_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.addUpdateRemoteTrack(t, remoteParticipant, true);
|
|
843
|
+
this.registerTrack(track, remoteParticipant, kind);
|
|
846
844
|
return [2 /*return*/];
|
|
847
845
|
});
|
|
848
846
|
}); };
|
|
@@ -987,12 +985,13 @@ var WebrtcHandler = /** @class */ (function (_super) {
|
|
|
987
985
|
// throw new Error("Method not implemented.");
|
|
988
986
|
};
|
|
989
987
|
WebrtcHandler.prototype.onAllParticipants = function (participants) {
|
|
988
|
+
var _a;
|
|
990
989
|
return __awaiter(this, void 0, void 0, function () {
|
|
991
990
|
var selfParticpant;
|
|
992
991
|
var _this = this;
|
|
993
|
-
return __generator(this, function (
|
|
994
|
-
selfParticpant = this.communicationHandler.getSelfParticipant();
|
|
995
|
-
if (selfParticpant.isStartMeetingCalled) {
|
|
992
|
+
return __generator(this, function (_b) {
|
|
993
|
+
selfParticpant = (_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.getSelfParticipant();
|
|
994
|
+
if (selfParticpant && selfParticpant.isStartMeetingCalled) {
|
|
996
995
|
participants.forEach(function (eachParticiapant) {
|
|
997
996
|
_this.onUserJoined(eachParticiapant);
|
|
998
997
|
});
|
|
@@ -1001,6 +1000,28 @@ var WebrtcHandler = /** @class */ (function (_super) {
|
|
|
1001
1000
|
});
|
|
1002
1001
|
});
|
|
1003
1002
|
};
|
|
1003
|
+
WebrtcHandler.prototype.onUserLeft = function (participant) {
|
|
1004
|
+
var _a;
|
|
1005
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1006
|
+
var selfParticpant, peerConnection;
|
|
1007
|
+
return __generator(this, function (_b) {
|
|
1008
|
+
try {
|
|
1009
|
+
selfParticpant = (_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.getSelfParticipant();
|
|
1010
|
+
if (selfParticpant) {
|
|
1011
|
+
peerConnection = selfParticpant.isPeerConnectionsViaUserIdPresent(participant.userId);
|
|
1012
|
+
if (peerConnection) {
|
|
1013
|
+
peerConnection.rtcPeerConnection.close();
|
|
1014
|
+
selfParticpant.removePeerConnectionsViaUserId(participant.userId);
|
|
1015
|
+
this.printLogIfRequired("onUserLeft after", selfParticpant.getPeerConnections());
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
catch (err) {
|
|
1020
|
+
}
|
|
1021
|
+
return [2 /*return*/];
|
|
1022
|
+
});
|
|
1023
|
+
});
|
|
1024
|
+
};
|
|
1004
1025
|
WebrtcHandler.prototype.onUserJoined = function (participant) {
|
|
1005
1026
|
return __awaiter(this, void 0, void 0, function () {
|
|
1006
1027
|
return __generator(this, function (_a) {
|