mirror of https://github.com/OpenVidu/openvidu.git
openvidu-java-client: custom recording layout
parent
a228b1242e
commit
fc8c18e054
|
@ -98,6 +98,8 @@ public class OpenVidu {
|
||||||
json.put("name", properties.name());
|
json.put("name", properties.name());
|
||||||
json.put("recordingLayout",
|
json.put("recordingLayout",
|
||||||
(properties.recordingLayout() != null) ? properties.recordingLayout().name() : "");
|
(properties.recordingLayout() != null) ? properties.recordingLayout().name() : "");
|
||||||
|
json.put("customLayout",
|
||||||
|
(properties.customLayout() != null) ? properties.customLayout() : "");
|
||||||
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");
|
||||||
|
|
|
@ -4,5 +4,6 @@ public enum RecordingLayout {
|
||||||
BEST_FIT, // All the videos are evenly distributed, taking up as much space as possible
|
BEST_FIT, // All the videos are evenly distributed, taking up as much space as possible
|
||||||
PICTURE_IN_PICTURE,
|
PICTURE_IN_PICTURE,
|
||||||
VERTICAL_PRESENTATION,
|
VERTICAL_PRESENTATION,
|
||||||
HORIZONTAL_PRESENTATION
|
HORIZONTAL_PRESENTATION,
|
||||||
|
CUSTOM
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,16 @@ public class RecordingProperties {
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private RecordingLayout recordingLayout;
|
private RecordingLayout recordingLayout;
|
||||||
|
private String customLayout;
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private String name = "";
|
private String name = "";
|
||||||
private RecordingLayout recordingLayout;
|
private RecordingLayout recordingLayout;
|
||||||
|
private String customLayout;
|
||||||
|
|
||||||
public RecordingProperties build() {
|
public RecordingProperties build() {
|
||||||
return new RecordingProperties(this.name, this.recordingLayout);
|
return new RecordingProperties(this.name, this.recordingLayout, this.customLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RecordingProperties.Builder name(String name) {
|
public RecordingProperties.Builder name(String name) {
|
||||||
|
@ -24,11 +26,17 @@ public class RecordingProperties {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RecordingProperties.Builder customLayout(String path) {
|
||||||
|
this.customLayout = path;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected RecordingProperties(String name, RecordingLayout layout) {
|
}
|
||||||
|
|
||||||
|
protected RecordingProperties(String name, RecordingLayout layout, String customLayout) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.recordingLayout = layout;
|
this.recordingLayout = layout;
|
||||||
|
this.customLayout = customLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String name() {
|
public String name() {
|
||||||
|
@ -39,4 +47,8 @@ public class RecordingProperties {
|
||||||
return this.recordingLayout;
|
return this.recordingLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String customLayout() {
|
||||||
|
return this.customLayout;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,9 +44,10 @@ 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("defaultRecordingLayout", properties.defaultRecordingLayout().name());
|
|
||||||
json.put("recordingMode", properties.recordingMode().name());
|
|
||||||
json.put("mediaMode", properties.mediaMode().name());
|
json.put("mediaMode", properties.mediaMode().name());
|
||||||
|
json.put("recordingMode", properties.recordingMode().name());
|
||||||
|
json.put("defaultRecordingLayout", properties.defaultRecordingLayout().name());
|
||||||
|
json.put("defaultCustomLayout", properties.defaultCustomLayout());
|
||||||
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");
|
||||||
|
|
|
@ -5,15 +5,18 @@ public class SessionProperties {
|
||||||
private MediaMode mediaMode;
|
private MediaMode mediaMode;
|
||||||
private RecordingMode recordingMode;
|
private RecordingMode recordingMode;
|
||||||
private RecordingLayout defaultRecordingLayout;
|
private RecordingLayout defaultRecordingLayout;
|
||||||
|
private String defaultCustomLayout;
|
||||||
|
|
||||||
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 defaultRecordingLayout = RecordingLayout.BEST_FIT;
|
private RecordingLayout defaultRecordingLayout = RecordingLayout.BEST_FIT;
|
||||||
|
private String defaultCustomLayout = "";
|
||||||
|
|
||||||
public SessionProperties build() {
|
public SessionProperties build() {
|
||||||
return new SessionProperties(this.mediaMode, this.recordingMode, this.defaultRecordingLayout);
|
return new SessionProperties(this.mediaMode, this.recordingMode, this.defaultRecordingLayout,
|
||||||
|
this.defaultCustomLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SessionProperties.Builder mediaMode(MediaMode mediaMode) {
|
public SessionProperties.Builder mediaMode(MediaMode mediaMode) {
|
||||||
|
@ -31,18 +34,26 @@ public class SessionProperties {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SessionProperties.Builder defaultCustomLayout(String path) {
|
||||||
|
this.defaultCustomLayout = path;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected SessionProperties() {
|
protected SessionProperties() {
|
||||||
this.mediaMode = MediaMode.ROUTED;
|
this.mediaMode = MediaMode.ROUTED;
|
||||||
this.recordingMode = RecordingMode.MANUAL;
|
this.recordingMode = RecordingMode.MANUAL;
|
||||||
this.defaultRecordingLayout = RecordingLayout.BEST_FIT;
|
this.defaultRecordingLayout = RecordingLayout.BEST_FIT;
|
||||||
|
this.defaultCustomLayout = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
private SessionProperties(MediaMode mediaMode, RecordingMode recordingMode, RecordingLayout layout) {
|
private SessionProperties(MediaMode mediaMode, RecordingMode recordingMode, RecordingLayout layout,
|
||||||
|
String defaultCustomLayout) {
|
||||||
this.mediaMode = mediaMode;
|
this.mediaMode = mediaMode;
|
||||||
this.recordingMode = recordingMode;
|
this.recordingMode = recordingMode;
|
||||||
this.defaultRecordingLayout = layout;
|
this.defaultRecordingLayout = layout;
|
||||||
|
this.defaultCustomLayout = defaultCustomLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RecordingMode recordingMode() {
|
public RecordingMode recordingMode() {
|
||||||
|
@ -57,4 +68,8 @@ public class SessionProperties {
|
||||||
return this.defaultRecordingLayout;
|
return this.defaultRecordingLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String defaultCustomLayout() {
|
||||||
|
return this.defaultCustomLayout;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue