更换播放器, 修正和优化sql脚本,
This commit is contained in:
@@ -34,11 +34,13 @@ public class ZLMRTPServerFactory {
|
||||
if (currentStreams == null) {
|
||||
currentStreams = new HashMap<>();
|
||||
JSONObject jsonObject = zlmresTfulUtils.listRtpServer();
|
||||
JSONArray data = jsonObject.getJSONArray("data");
|
||||
if (data != null) {
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject dataItem = data.getJSONObject(i);
|
||||
currentStreams.put(dataItem.getString("stream_id"), dataItem.getInteger("port"));
|
||||
if (jsonObject != null) {
|
||||
JSONArray data = jsonObject.getJSONArray("data");
|
||||
if (data != null) {
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject dataItem = data.getJSONObject(i);
|
||||
currentStreams.put(dataItem.getString("stream_id"), dataItem.getInteger("port"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,12 +75,12 @@ public class ZLMRTPServerFactory {
|
||||
result= createRTPServer(streamId);
|
||||
break;
|
||||
default:
|
||||
logger.error("创建RTP Server 失败: " + jsonObject.getString("msg"));
|
||||
logger.error("创建RTP Server 失败 {}: " + jsonObject.getString("msg"), newPort);
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
// 检查ZLM状态
|
||||
logger.error("创建RTP Server 失败: 请检查ZLM服务");
|
||||
logger.error("创建RTP Server 失败 {}: 请检查ZLM服务", newPort);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public class ZLMRunner implements CommandLineRunner {
|
||||
if (responseJSON != null && responseJSON.getInteger("code") == 0) {
|
||||
logger.info("设置zlm成功");
|
||||
}else {
|
||||
logger.info("设置zlm失败: " + responseJSON.getString("msg"));
|
||||
logger.info("设置zlm失败");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,6 +155,9 @@ public class ZLMRunner implements CommandLineRunner {
|
||||
// 设置为未启用
|
||||
logger.info("恢复流代理失败,请检查流地址后重新启用" + streamProxyDto.getApp() + "/" + streamProxyDto.getStream());
|
||||
streamProxyService.stop(streamProxyDto.getApp(), streamProxyDto.getStream());
|
||||
}else if (jsonObject.getInteger("code") != 0){ // TODO 将错误信息存入数据库, 前端展示
|
||||
logger.info("恢复流代理失败:" + streamProxyDto.getApp() + "/" + streamProxyDto.getStream() + "[ " + JSONObject.toJSONString(jsonObject) + " ]");
|
||||
streamProxyService.stop(streamProxyDto.getApp(), streamProxyDto.getStream());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user