浏览代码

云端录制

zouxuan 3 年之前
父节点
当前提交
c359891964

+ 1 - 0
mec-im/src/main/java/com/ym/controller/LiveRoomController.java

@@ -47,6 +47,7 @@ public class LiveRoomController {
     @ApiOperation("录制结果回调")
     @RequestMapping(value = "/recordSync")
     public void recordSync(@RequestBody String body){
+        log.info("recordSync body:{}",body);
         RecordNotify recordNotify = JSONObject.parseObject(body, RecordNotify.class);
         liveRoomService.recordSync(recordNotify);
     }

+ 42 - 7
mec-im/src/main/java/com/ym/pojo/RecordNotifyOutput.java

@@ -10,13 +10,48 @@ public class RecordNotifyOutput {
     Long audioSample;
     //视频分辨率,如 640x480
     String videoResoulation;
+    //切片生成的录制文件大小
+    Integer fileSize;
+    //已上传到的第三方存储的 URL
+    String fileUrl;
 
-    @Override
-    public String toString() {
-        return "RecordNotifyOutput{" +
-                "fileName='" + fileName + '\'' +
-                ", audioSample=" + audioSample +
-                ", videoResoulation='" + videoResoulation + '\'' +
-                '}';
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getAudioSample() {
+        return audioSample;
+    }
+
+    public void setAudioSample(Long audioSample) {
+        this.audioSample = audioSample;
+    }
+
+    public String getVideoResoulation() {
+        return videoResoulation;
+    }
+
+    public void setVideoResoulation(String videoResoulation) {
+        this.videoResoulation = videoResoulation;
+    }
+
+    public Integer getFileSize() {
+        return fileSize;
+    }
+
+    public void setFileSize(Integer fileSize) {
+        this.fileSize = fileSize;
+    }
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
     }
 }

+ 7 - 1
mec-im/src/main/java/com/ym/service/Impl/LiveRoomServiceImpl.java

@@ -137,7 +137,13 @@ public class LiveRoomServiceImpl implements LiveRoomService {
 
     @Override
     public void recordSync(RecordNotify recordNotify) {
-        log.info("recordSync recordNotify:{}",recordNotify);
+        if(recordNotify.getCode().equals(200)){
+            if(recordNotify.getType() != null && recordNotify.getType() == 4){
+                //文件地址
+                String fileUrl = recordNotify.getOutput().getFileUrl();
+
+            }
+        }
     }
 
     public String getRoomSessionId(String roomId){