| | |
| | | @Override |
| | | public StreamInfo save(StreamProxyItem param) { |
| | | MediaServerItem mediaInfo; |
| | | if (param.getMediaServerId() == null || "auto".equals(param.getMediaServerId())){ |
| | | if (ObjectUtils.isEmpty(param.getMediaServerId()) || "auto".equals(param.getMediaServerId())){ |
| | | mediaInfo = mediaServerService.getMediaServerForMinimumLoad(); |
| | | }else { |
| | | mediaInfo = mediaServerService.getOne(param.getMediaServerId()); |
| | |
| | | public boolean start(String app, String stream) { |
| | | boolean result = false; |
| | | StreamProxyItem streamProxy = videoManagerStorager.queryStreamProxy(app, stream); |
| | | if (!streamProxy.isEnable() ) { |
| | | if (streamProxy != null && !streamProxy.isEnable() ) { |
| | | JSONObject jsonObject = addStreamProxyToZlm(streamProxy); |
| | | if (jsonObject == null) { |
| | | return false; |
| | | } |
| | | System.out.println(jsonObject); |
| | | if (jsonObject.getInteger("code") == 0) { |
| | | result = true; |
| | | streamProxy.setEnable(true); |
| | |
| | | if(data != null && data.size() > 0) { |
| | | for (int i = 0; i < data.size(); i++) { |
| | | JSONObject streamJSONObj = data.getJSONObject(i); |
| | | if ("rtmp".equals(streamJSONObj.getString("schema"))) { |
| | | if ("rtsp".equals(streamJSONObj.getString("schema"))) { |
| | | StreamInfo streamInfo = new StreamInfo(); |
| | | String app = streamJSONObj.getString("app"); |
| | | String stream = streamJSONObj.getString("stream"); |