فهرست منبع

1、流域名进行配置话

yfh 2 روز پیش
والد
کامیت
4d0abd3d54
1فایلهای تغییر یافته به همراه12 افزوده شده و 5 حذف شده
  1. 12 5
      fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

+ 12 - 5
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -55,6 +55,7 @@ import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.util.EntityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import com.fs.common.utils.sign.Md5Utils;
@@ -123,7 +124,7 @@ public class LiveServiceImpl implements ILiveService
     private CompanyMapper companyMapper;
     @Autowired
     private LiveCouponMapper liveCouponMapper;
-    
+
     @Autowired
     LiveTagConfigMapper liveTagConfigMapper;
 
@@ -282,7 +283,7 @@ public class LiveServiceImpl implements ILiveService
             }
         }
         liveVo.setCompletionPointsEnabled(completionPointsEnabled);
-        
+
         LiveVideo liveVideo = liveVideoService.selectLiveVideoByLiveIdAndType(id, 3);
         if (liveVideo != null) {
             liveVo.setPreviewUrl(liveVideo.getVideoUrl());
@@ -636,7 +637,7 @@ public class LiveServiceImpl implements ILiveService
             liveTagConfigMapper.deleteByLiveId(live.getLiveId());
             insertLiveTagConfig(live.getLiveTagList(),live.getLiveId(),live.getCreateBy());
         }
-        
+
         return result;
     }
 
@@ -937,8 +938,14 @@ public class LiveServiceImpl implements ILiveService
         if (live.getCompanyId() != null && exist.getCompanyId() != null && !Objects.equals(exist.getCompanyId(), live.getCompanyId())) {
             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");
+        Map<String, String> livingConfigMap = JSON.parseObject(sysConfig.getConfigValue(), Map.class);
+        if (livingConfigMap == null || livingConfigMap.isEmpty()) {
+            return R.error("缺失直播配置");
+        }
+        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);