| | |
| | | |
| | | public JSONObject sendPost(MediaServerItem mediaServerItem, String api, Map<String, Object> param, RequestCallback callback) { |
| | | OkHttpClient client = new OkHttpClient(); |
| | | if (mediaServerItem == null) { |
| | | return null; |
| | | } |
| | | String url = String.format("http://%s:%s/index/api/%s", mediaServerItem.getIp(), mediaServerItem.getHttpPort(), api); |
| | | JSONObject responseJSON = null; |
| | | |
| | |
| | | return sendPost(mediaServerItem, "stopSendRtp",param, null); |
| | | } |
| | | |
| | | public JSONObject restartServer(MediaServerItem mediaServerItem) { |
| | | return sendPost(mediaServerItem, "restartServer",null, null); |
| | | } |
| | | |
| | | public JSONObject addStreamProxy(MediaServerItem mediaServerItem, String app, String stream, String url, boolean enable_hls, boolean enable_mp4, String rtp_type) { |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("vhost", "__defaultVhost__"); |