|
|
@@ -739,8 +739,22 @@ public class LiveServiceImpl implements ILiveService
|
|
|
if (exist.getIsShow() != 1) {
|
|
|
return R.error("直播已下架");
|
|
|
}
|
|
|
- String rtmpPushUrl = generateRtmpPushUrl("rtmp://200149.push.tlivecloud.com", "live", exist.getLiveId().toString());
|
|
|
- String hlvPlayUrl = generateHlvPlayUrl("https://live.test.ifeiyu100.com", "live", exist.getLiveId().toString());
|
|
|
+ SysConfig sysConfig = sysConfigService.selectConfigByConfigKey("living.config");
|
|
|
+ if (sysConfig == null || StringUtils.isEmpty(sysConfig.getConfigValue())) {
|
|
|
+ log.error("直播配置不存在或为空, liveId: {}", live.getLiveId());
|
|
|
+ return R.error("直播配置不存在,请联系管理员配置");
|
|
|
+ }
|
|
|
+ Map<String, String> livingConfigMap = JSON.parseObject(sysConfig.getConfigValue(), Map.class);
|
|
|
+ if (livingConfigMap == null || livingConfigMap.isEmpty()) {
|
|
|
+ log.error("直播配置解析失败, liveId: {}, configValue: {}", live.getLiveId(), sysConfig.getConfigValue());
|
|
|
+ return R.error("直播配置解析失败");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(livingConfigMap.get("domain")) || StringUtils.isEmpty(livingConfigMap.get("app"))) {
|
|
|
+ log.error("直播配置缺少必要参数, liveId: {}, configMap: {}", live.getLiveId(), livingConfigMap);
|
|
|
+ return R.error("直播配置缺少必要参数(domain/app)");
|
|
|
+ }
|
|
|
+ String rtmpPushUrl = generateRtmpPushUrl(livingConfigMap.get("domain"), livingConfigMap.get("app"), exist.getLiveId().toString());
|
|
|
+ String hlvPlayUrl = generateHlvPlayUrl(livingConfigMap.get("http"), livingConfigMap.get("app"), exist.getLiveId().toString());
|
|
|
Date now = new Date();
|
|
|
exist.setRtmpUrl(rtmpPushUrl);
|
|
|
exist.setFlvHlsUrl(hlvPlayUrl);
|