|
@@ -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.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.net.HttpURLConnection;
|
|
@@ -226,11 +227,11 @@ public class IMHelper {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- public IMApiResultInfo startRecord(String hostUserId, String roomId) throws Exception {
|
|
|
+ @Async
|
|
|
+ public IMApiResultInfo startRecord(String hostUserId, String roomId,Long registrationId) throws Exception {
|
|
|
if (hostUserId == null) {
|
|
|
throw new IllegalArgumentException("Paramer 'hostUserId' is required");
|
|
|
}
|
|
|
-
|
|
|
if (roomId == null) {
|
|
|
throw new IllegalArgumentException("Paramer 'roomId' is required");
|
|
|
}
|
|
@@ -242,17 +243,17 @@ public class IMHelper {
|
|
|
jsonObject.put("mixLayout",3);
|
|
|
jsonObject.put("sliceMin",60);
|
|
|
jsonObject.put("hostUserId",hostUserId);
|
|
|
+ jsonObject.put("extra",registrationId);
|
|
|
JSONObject json = new JSONObject();
|
|
|
- String sessionId = roomQuery(roomId);
|
|
|
- json.put("sessionId",sessionId);
|
|
|
+ json.put("sessionId",roomQuery(roomId));
|
|
|
json.put("config",jsonObject);
|
|
|
|
|
|
String body = json.toJSONString();
|
|
|
|
|
|
+ Thread.sleep(1000l);
|
|
|
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);
|
|
|
- resultInfo.setSessionId(sessionId);
|
|
|
return resultInfo;
|
|
|
}
|
|
|
|