mirror of https://github.com/OpenVidu/openvidu.git
openvidu-java-client: defaultRecordingLayout and recordingLayout
parent
c0cf7d9d4e
commit
6d569ae94e
|
@ -96,6 +96,8 @@ public class OpenVidu {
|
|||
JSONObject json = new JSONObject();
|
||||
json.put("session", sessionId);
|
||||
json.put("name", properties.name());
|
||||
json.put("recordingLayout",
|
||||
(properties.recordingLayout() != null) ? properties.recordingLayout().name() : "");
|
||||
StringEntity params = new StringEntity(json.toString());
|
||||
|
||||
request.setHeader(HttpHeaders.CONTENT_TYPE, "application/json");
|
||||
|
|
|
@ -16,7 +16,6 @@ public class Recording {
|
|||
private Recording.Status status;
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String sessionId;
|
||||
private long createdAt; // milliseconds (UNIX Epoch time)
|
||||
private long size = 0; // bytes
|
||||
|
@ -24,10 +23,10 @@ public class Recording {
|
|||
private String url;
|
||||
private boolean hasAudio = true;
|
||||
private boolean hasVideo = true;
|
||||
private RecordingProperties recordingProperties;
|
||||
|
||||
public Recording(JSONObject json) {
|
||||
this.id = (String) json.get("id");
|
||||
this.name = (String) json.get("name");
|
||||
this.sessionId = (String) json.get("sessionId");
|
||||
this.createdAt = (long) json.get("createdAt");
|
||||
this.size = (long) json.get("size");
|
||||
|
@ -36,6 +35,8 @@ public class Recording {
|
|||
this.hasAudio = (boolean) json.get("hasAudio");
|
||||
this.hasVideo = (boolean) json.get("hasVideo");
|
||||
this.status = Recording.Status.valueOf((String) json.get("status"));
|
||||
this.recordingProperties = new RecordingProperties.Builder().name((String) json.get("name"))
|
||||
.recordingLayout(RecordingLayout.valueOf((String) json.get("layout"))).build();
|
||||
}
|
||||
|
||||
public Recording.Status getStatus() {
|
||||
|
@ -47,7 +48,11 @@ public class Recording {
|
|||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
return this.recordingProperties.name();
|
||||
}
|
||||
|
||||
public RecordingLayout getLayout() {
|
||||
return this.recordingProperties.recordingLayout();
|
||||
}
|
||||
|
||||
public String getSessionId() {
|
||||
|
|
|
@ -3,13 +3,15 @@ package io.openvidu.java.client;
|
|||
public class RecordingProperties {
|
||||
|
||||
private String name;
|
||||
private RecordingLayout recordingLayout;
|
||||
|
||||
public static class Builder {
|
||||
|
||||
private String name = "";
|
||||
private RecordingLayout recordingLayout;
|
||||
|
||||
public RecordingProperties build() {
|
||||
return new RecordingProperties(this.name);
|
||||
return new RecordingProperties(this.name, this.recordingLayout);
|
||||
}
|
||||
|
||||
public RecordingProperties.Builder name(String name) {
|
||||
|
@ -17,14 +19,24 @@ public class RecordingProperties {
|
|||
return this;
|
||||
}
|
||||
|
||||
public RecordingProperties.Builder recordingLayout(RecordingLayout layout) {
|
||||
this.recordingLayout = layout;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected RecordingProperties(String name) {
|
||||
}
|
||||
|
||||
protected RecordingProperties(String name, RecordingLayout layout) {
|
||||
this.name = name;
|
||||
this.recordingLayout = layout;
|
||||
}
|
||||
|
||||
public String name() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public RecordingLayout recordingLayout() {
|
||||
return this.recordingLayout;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class Session {
|
|||
HttpPost request = new HttpPost(this.urlOpenViduServer + API_SESSIONS);
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("recordingLayout", properties.recordingLayout().name());
|
||||
json.put("defaultRecordingLayout", properties.defaultRecordingLayout().name());
|
||||
json.put("recordingMode", properties.recordingMode().name());
|
||||
json.put("mediaMode", properties.mediaMode().name());
|
||||
StringEntity params = new StringEntity(json.toString());
|
||||
|
|
|
@ -4,16 +4,16 @@ public class SessionProperties {
|
|||
|
||||
private MediaMode mediaMode;
|
||||
private RecordingMode recordingMode;
|
||||
private RecordingLayout recordingLayout;
|
||||
private RecordingLayout defaultRecordingLayout;
|
||||
|
||||
public static class Builder {
|
||||
|
||||
private MediaMode mediaMode = MediaMode.ROUTED;
|
||||
private RecordingMode recordingMode = RecordingMode.MANUAL;
|
||||
private RecordingLayout recordingLayout = RecordingLayout.BEST_FIT;
|
||||
private RecordingLayout defaultRecordingLayout = RecordingLayout.BEST_FIT;
|
||||
|
||||
public SessionProperties build() {
|
||||
return new SessionProperties(this.mediaMode, this.recordingMode, this.recordingLayout);
|
||||
return new SessionProperties(this.mediaMode, this.recordingMode, this.defaultRecordingLayout);
|
||||
}
|
||||
|
||||
public SessionProperties.Builder mediaMode(MediaMode mediaMode) {
|
||||
|
@ -26,8 +26,8 @@ public class SessionProperties {
|
|||
return this;
|
||||
}
|
||||
|
||||
public SessionProperties.Builder recordingLayout(RecordingLayout recordingLayout) {
|
||||
this.recordingLayout = recordingLayout;
|
||||
public SessionProperties.Builder defaultRecordingLayout(RecordingLayout layout) {
|
||||
this.defaultRecordingLayout = layout;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -36,13 +36,13 @@ public class SessionProperties {
|
|||
protected SessionProperties() {
|
||||
this.mediaMode = MediaMode.ROUTED;
|
||||
this.recordingMode = RecordingMode.MANUAL;
|
||||
this.recordingLayout = RecordingLayout.BEST_FIT;
|
||||
this.defaultRecordingLayout = RecordingLayout.BEST_FIT;
|
||||
}
|
||||
|
||||
private SessionProperties(MediaMode mediaMode, RecordingMode recordingMode, RecordingLayout recordingLayout) {
|
||||
private SessionProperties(MediaMode mediaMode, RecordingMode recordingMode, RecordingLayout layout) {
|
||||
this.mediaMode = mediaMode;
|
||||
this.recordingMode = recordingMode;
|
||||
this.recordingLayout = recordingLayout;
|
||||
this.defaultRecordingLayout = layout;
|
||||
}
|
||||
|
||||
public RecordingMode recordingMode() {
|
||||
|
@ -53,8 +53,8 @@ public class SessionProperties {
|
|||
return this.mediaMode;
|
||||
}
|
||||
|
||||
public RecordingLayout recordingLayout() {
|
||||
return this.recordingLayout;
|
||||
public RecordingLayout defaultRecordingLayout() {
|
||||
return this.defaultRecordingLayout;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue