|
@@ -10,6 +10,7 @@ import com.keao.edu.im.pojo.IMTokenInfo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -27,6 +28,9 @@ public class IMHelper {
|
|
|
@Autowired
|
|
|
HttpHelper httpHelper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RedisTemplate<String,String> redisTemplate;
|
|
|
+
|
|
|
/**
|
|
|
* 获取 Token 方法
|
|
|
*
|
|
@@ -240,10 +244,9 @@ public class IMHelper {
|
|
|
jsonObject.put("videoFormat","mp4");
|
|
|
jsonObject.put("audioFormat","mp3");
|
|
|
jsonObject.put("videoResolution","640x480");
|
|
|
- jsonObject.put("mixLayout",3);
|
|
|
- jsonObject.put("sliceMin",60);
|
|
|
+ jsonObject.put("mixLayout",2);
|
|
|
+ jsonObject.put("sliceMin",30);
|
|
|
jsonObject.put("hostUserId",hostUserId);
|
|
|
- jsonObject.put("extra",registrationId);
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("sessionId",roomQuery(roomId));
|
|
|
json.put("config",jsonObject);
|
|
@@ -254,6 +257,9 @@ public class IMHelper {
|
|
|
HttpURLConnection conn = httpHelper.createIMRtcPostHttpConnection("/rtc/record/start.json", "application/json",roomId);
|
|
|
httpHelper.setBodyParameter(body, conn);
|
|
|
IMApiResultInfo resultInfo = JSON.parseObject(httpHelper.returnResult(conn, body), IMApiResultInfo.class);
|
|
|
+ if(resultInfo.getResultCode() == 10000){
|
|
|
+ redisTemplate.opsForValue().set(resultInfo.getRecordId(),registrationId.toString());
|
|
|
+ }
|
|
|
return resultInfo;
|
|
|
}
|
|
|
|
|
@@ -276,8 +282,8 @@ public class IMHelper {
|
|
|
jsonObject.put("videoFormat","mp4");
|
|
|
jsonObject.put("audioFormat","mp3");
|
|
|
jsonObject.put("videoResolution","640x480");
|
|
|
- jsonObject.put("mixLayout",3);
|
|
|
- jsonObject.put("sliceMin",60);
|
|
|
+ jsonObject.put("mixLayout",2);
|
|
|
+ jsonObject.put("sliceMin",30);
|
|
|
jsonObject.put("hostUserId",hostUserId);
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("sessionId",roomQuery(roomId));
|