}
public synchronized int sendBrowserMessageToMembers(Object newMessage) {
try {
IConnection current = Red5.getConnectionLocal();
RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
List newMessageList = (List) newMessage;
String action = newMessageList.get(0).toString();
//"closeBrowserURL"
//"initBrowser"
//newBrowserURL
BrowserStatus browserStatus = (BrowserStatus) current.getScope().getAttribute("browserStatus");
if (browserStatus == null) {
browserStatus = new BrowserStatus();
}
if (action.equals("initBrowser") || action.equals("newBrowserURL")) {
browserStatus.setBrowserInited(true);
browserStatus.setCurrentURL(newMessageList.get(1).toString());
} else if (action.equals("closeBrowserURL")) {
browserStatus.setBrowserInited(false);
}
current.getScope().setAttribute("browserStatus", browserStatus);
//Send to all Clients of that Scope(Room)
Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
for (Set<IConnection> conset : conCollection) {
for (IConnection conn : conset) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
if (rcl == null || (rcl.getIsScreenClient() != null && rcl.getIsScreenClient())) {
//continue;
} else {
if (!currentClient.getStreamid().equals(rcl.getStreamid())) {
//log.debug("*..*idremote: " + rcl.getStreamid());
//log.debug("*..*my idstreamid: " + currentClient.getStreamid());
((IServiceCapableConnection) conn).invoke("sendVarsToMessage",new Object[] { newMessage }, this);
//log.debug("sending sendVarsToMessage to " + conn);
}