httpServletResponse.setHeader("Content-Disposition","Inline; filename=\"" + requestedFile + "\"");
String template = "rtp_player_applet.vm";
// Retrieve Data from RTPmanager
RTPScreenSharingSession rsss = RTPStreamingHandler.getSessionForRoom(room, sid, publicSID);
if(rsss == null){
log.error("no RTPSharingSession available for room " + room);
return null;
}
log.debug("Trying to connect on Stream (origin : " + rsss.getSharingIpAddress() + ")");
// Defining Port for Viewer...
HashMap<String, Integer> preDefindedUsers = rsss.getViewers();
if(preDefindedUsers.size() < 1)
throw new Exception("No predefined viewers available in RTPSharingSession!!");
Iterator<String> citer = preDefindedUsers.keySet().iterator();
Integer myPort = null;
log.debug("Trying to resolve publicSID for sharerApplet : " + publicSID);
log.debug("Dumping Viewers MAP : ");
log.debug("-------------------------------------");
Iterator<String> testiter = preDefindedUsers.keySet().iterator();
while(testiter.hasNext()){
String clientPublicSid = testiter.next();
Integer port = preDefindedUsers.get(clientPublicSid);
log.debug("Viewer : " + clientPublicSid + " : " + port);
}
log.debug("-------------------------------------");
while(citer.hasNext()){
String myClientSID = citer.next();
Integer port = preDefindedUsers.get(myClientSID);
log.debug("Trying Client with publicSID " + myClientSID);
if(myClientSID.equals(publicSID)){
log.debug("HIT!!!");
myPort = port;
break;
}
}
// TODO : this would be a valid entrypoint to add a new viewer, if he is part of
// the conference (check via ClientList per room) and came late ;-)
if(myPort == null)
throw new Exception("Predefindes Viewer List does not contain publicSID(" + publicSID +") !");
ctx.put("HOST", InetAddress.getLocalHost().getHostAddress());
ctx.put("PORT", myPort);
ctx.put("HEIGHT", rsss.getStreamHeight());
ctx.put("WIDTH", rsss.getStreamWidth());
log.debug("Put Variables to Velocity context : HOST=" + ctx.get("HOST") + ", PORT=" + ctx.get("PORT"));
log.debug("Received PubliSID : " + publicSID );
//RoomClient rcl = ClientListManager.getInstance().getClientByPublicSID(publicSID);