protected void onCommand(RTMPConnection conn, Channel channel, Header source, ICommand command) {
if (!(command instanceof Notify)) {
return;
}
Notify invoke = (Notify)command;
if (invoke.getType() == IEvent.Type.STREAM_DATA) {
return;
}
String method = invoke.getCall().getServiceMethodName();
if ("stopStream".equals(method)) {
stopStream();
} else if ("sendRemoteCursorEvent".equals(method)) {
sendRemoteCursorEvent(invoke.getCall().getArguments()[0]);
} else if ("screenSharerAction".equals(method)) {
Object[] args = invoke.getCall().getArguments();
if (args != null && args.length > 0) {
@SuppressWarnings("unchecked")
Map<String, Object> params = (Map<String, Object>)args[0];
if (bool(params.get("stopPublishing"))) {
stopPublishing();