| | |
| | | * zlm 连接成功或者zlm重启后 |
| | | */ |
| | | private void zLmRunning(MediaServerConfig mediaServerConfig){ |
| | | logger.info("zlm接入成功..."); |
| | | logger.info( "[ id: " + mediaServerConfig.getGeneralMediaServerId() + "] zlm接入成功..."); |
| | | if (autoConfig) saveZLMConfig(); |
| | | MediaServerConfig mediaInfo = redisCatchStorage.getMediaInfo(); |
| | | if (mediaInfo != null && System.currentTimeMillis() - mediaInfo.getUpdateTime() < 50){ |
| | | logger.info("zlm刚刚更新,忽略这次更新"); |
| | | logger.info("[ id: " + mediaServerConfig.getGeneralMediaServerId() + "]zlm刚刚更新,忽略这次更新"); |
| | | return; |
| | | } |
| | | mediaServerConfig.setLocalIP(mediaIp); |
| | |
| | | List<StreamProxyItem> streamProxyListForEnable = storager.getStreamProxyListForEnable(true); |
| | | for (StreamProxyItem streamProxyDto : streamProxyListForEnable) { |
| | | logger.info("恢复流代理," + streamProxyDto.getApp() + "/" + streamProxyDto.getStream()); |
| | | streamProxyService.addStreamProxyToZlm(streamProxyDto); |
| | | JSONObject jsonObject = streamProxyService.addStreamProxyToZlm(streamProxyDto); |
| | | if (jsonObject == null) { |
| | | // 设置为未启用 |
| | | logger.info("恢复流代理失败,请检查流地址后重新启用" + streamProxyDto.getApp() + "/" + streamProxyDto.getStream()); |
| | | streamProxyService.stop(streamProxyDto.getApp(), streamProxyDto.getStream()); |
| | | } |
| | | } |
| | | } |
| | | } |