protected void cmdCreateStream(MessageInfo mi, RTMPCommand command) {
   AMFPacket response = new AMFPacket();
   response.writeString("_result");
   response.writeNumber(command.getTxid());
   response.writeMixed(null);
   response.writeMixed(1d);
   context.writeCommand(mi.chunkStreamID, mi.messageStreamID, response);
 }
 protected void sendError(MessageInfo mi, RTMPCommand command, Object object, Object information) {
   AMFPacket response = new AMFPacket();
   response.writeString("_error");
   response.writeNumber(command.getTxid());
   response.writeMixed(object);
   response.writeMixed(information);
   context.writeCommand(mi.chunkStreamID, mi.messageStreamID, response);
 }
  protected void cmdConnect(MessageInfo mi, RTMPCommand command) {

    AMFPacket response = new AMFPacket();
    response.writeString("_result");
    response.writeNumber(command.getTxid());

    Map<String, Object> arg1 = new HashMap<>();
    arg1.put("fmsVer", "FMS/3,5,5,2004");
    arg1.put("capabilities", 31d);
    arg1.put("mode", 1d);
    response.writeObject(arg1);

    Map<String, Object> arg2 = new HashMap<>();
    arg2.put("level", "status");
    arg2.put("code", "NetConnection.Connect.Success");
    arg2.put("description", "Connection succeeded");
    arg2.put("data", new Object[0]);
    arg2.put("clientId", 1d);
    arg2.put("objectEncoding", 0d);
    response.writeObject(arg2);

    context.writeCommand(mi.chunkStreamID, mi.messageStreamID, response);
  }
 protected void cmdFCPublish(MessageInfo mi, RTMPCommand command) {
   fcpublishTxID = command.getTxid();
   sendSuccess(mi, command);
 }