RoomClient rc = clientListManager.getClientByStreamId(conn.getClient().getId());
String publishName = rc.getStreamPublishName();
if (rc.getIsScreenClient() && rc.isStartStreaming()) {
IScope scope = conn.getScope();
IBroadcastStream stream = getBroadcastStream(scope, publishName);
IBroadcastScope bsScope = getBroadcastScope(scope, publishName);
final StreamingProxy proxy = new StreamingProxy();
proxy.setHost(host);
proxy.setApp(app);
proxy.setPort(1935);
proxy.init();
proxy.setExceptionHandler(new ClientExceptionHandler() {
public void handleException(Throwable throwable) {
result[0] = false;
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("stopPublishing", true);
params.put("error", throwable.getMessage());
((IServiceCapableConnection)conn).invoke(
"screenSharerAction"
, new Object[] { params }
, ScopeApplicationAdapter.this);
}
});
bsScope.subscribe(proxy, null);
proxy.start(id, "live", null);
streamingProxyMap.put(publishName, proxy);
stream.addStreamListener(new IStreamListener() {
public void packetReceived(IBroadcastStream stream, IStreamPacket packet) {
try {
RTMPMessage m = RTMPMessage.build((IRTMPEvent)packet, packet.getTimestamp());
proxy.pushMessage(null, m);
} catch (Exception e) {