public synchronized Map screenSharerAction(Map map) {
try {
IConnection current = Red5.getConnectionLocal();
RoomClient currentClient = this.clientListManager
.getClientByStreamId(current.getClient().getId());
Map returnMap = new HashMap();
returnMap.put("result", "stopAll");
log.debug("----------- ");
if (currentClient != null) {
if (Boolean.valueOf(map.get("stopStreaming").toString())) {
log.debug("start streamPublishStart Is Screen Sharing -- Stop ");
//Send message to all users
syncMessageToCurrentScope("stopRed5ScreenSharing", currentClient, false);
if (currentClient.isStartRecording()) {
returnMap.put("result", "stopSharingOnly");
}
currentClient.setStartStreaming(false);
currentClient.setScreenPublishStarted(false);
clientListManager.updateClientByStreamId(
currentClient.getStreamid(), currentClient);
}
if (Boolean.valueOf(map.get("stopRecording").toString())) {
if (currentClient.isStartStreaming()) {
returnMap.put("result", "stopRecordingOnly");
}
//Send message to all users
syncMessageToCurrentScope("stopRecordingMessage", currentClient, false);
flvRecorderService.stopRecordAndSave(
current.getScope(), currentClient, null);
currentClient.setStartRecording(false);
currentClient.setIsRecording(false);
clientListManager.updateClientByStreamId(
currentClient.getStreamid(), currentClient);
}
if (Boolean.valueOf(map.get("stopPublishing").toString())) {
streamPublishingStop();
if (currentClient.getIsScreenClient() && currentClient.isStartStreaming()) {
returnMap.put("result", "stopPublishingOnly");
}
}
}
return returnMap;