// IServiceCapableConnection service = (IServiceCapableConnection)
// current;
log.debug("### setConnectionAsSharingClient: ");
RoomClient currentClient = this.clientListManager
.getClientByStreamId(current.getClient().getId());
if (currentClient != null) {
boolean startRecording = Boolean.valueOf(map.get(
"startRecording").toString());
boolean startStreaming = Boolean.valueOf(map.get(
"startStreaming").toString());
currentClient.setRoom_id(Long.parseLong(current.getScope()
.getName()));
// Set this connection to be a RTMP-Java Client
currentClient.setIsScreenClient(true);
currentClient.setUser_id(Long.parseLong(map.get("user_id")
.toString()));
if (startStreaming) {
currentClient.setStartStreaming(true);
}
if (startRecording) {
currentClient.setStartRecording(true);
}
currentClient.setOrganization_id(Long.parseLong(map.get(
"organization_id").toString()));
this.clientListManager.updateClientByStreamId(current
.getClient().getId(), currentClient);
Map returnMap = new HashMap();
returnMap.put("alreadyPublished", false);
// if is already started screen sharing, then there is no need
// to start it again
if (currentClient.isScreenPublishStarted()) {
returnMap.put("alreadyPublished", true);
}
currentClient.setVX(Integer.parseInt(map.get("screenX")
.toString()));
currentClient.setVY(Integer.parseInt(map.get("screenY")
.toString()));
currentClient.setVWidth(Integer.parseInt(map.get("screenWidth")
.toString()));
currentClient.setVHeight(Integer.parseInt(map.get(
"screenHeight").toString()));
log.debug("screen x,y,width,height " + currentClient.getVX()
+ " " + currentClient.getVY() + " "
+ currentClient.getVWidth() + " "
+ currentClient.getVHeight());
log.debug("publishName :: " + map.get("publishName"));
currentClient.setStreamPublishName(map.get("publishName")
.toString());
RoomClient currentScreenUser = this.clientListManager
.getClientByPublicSID(currentClient
.getStreamPublishName(), false);
currentClient.setFirstname(currentScreenUser.getFirstname());
currentClient.setLastname(currentScreenUser.getLastname());
// This is duplicated, but its not sure that in the meantime
// somebody requests this Client Object Info
this.clientListManager.updateClientByStreamId(current
.getClient().getId(), currentClient);