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