vani-meeting-client
Version:
Vani Meeting Clinet SDK
50 lines (49 loc) • 2.1 kB
JavaScript
import { DynamicLibHelper } from "../utility/DynamicLibHelper";
import { PeerConnection } from "./PeerConnection";
var Participant = /** @class */ (function () {
function Participant(_userId, _roomId, _userData, _isAdmin) {
if (_userData === void 0) { _userData = {}; }
if (_isAdmin === void 0) { _isAdmin = false; }
var _this = this;
this.isAdmin = false;
this.isAudioBlockedByAdmin = false;
this.isVideoBlockedByAdmin = false;
this.isMessageBlockedByAdmin = false;
this.isWhiteboardBlockedByAdmin = true;
this.isScreenshareBlockedByAdmin = false;
this.isVideoEnable = false;
this.isAudioEnable = false;
this.isStartMeetingCalled = false;
this.isRecordingUser = false;
this.peerConnections = new Map();
this.getPeerConnections = function () {
if (!_this.peerConnections) {
_this.peerConnections = new Map();
}
return _this.peerConnections;
};
this.isPeerConnectionsViaUserIdPresent = function (userId) {
return _this.getPeerConnections().get(userId);
};
this.removePeerConnectionsViaUserId = function (userId) {
return _this.getPeerConnections().delete(userId);
};
this.getPeerConnectionsViaUserId = function (userId, meetingStartRequest) {
if (!_this.getPeerConnections().has(userId)) {
var peerConnection = new PeerConnection();
peerConnection.userId = userId;
if (!peerConnection.rtcPeerConnection) {
peerConnection.rtcPeerConnection = new DynamicLibHelper().getRTCPeerConnection(meetingStartRequest);
}
_this.getPeerConnections().set(userId, peerConnection);
}
return _this.getPeerConnections().get(userId);
};
this.userId = _userId;
this.roomId = _roomId;
this.userData = _userData;
this.isAdmin = _isAdmin;
}
return Participant;
}());
export { Participant };