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("recordingLayout",
|
||||
(properties.recordingLayout() != null) ? properties.recordingLayout().name() : "");
|
||||
json.put("customLayout",
|
||||
(properties.customLayout() != null) ? properties.customLayout() : "");
|
||||
StringEntity params = new StringEntity(json.toString());
|
||||
|
||||
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
|
||||
PICTURE_IN_PICTURE,
|
||||
VERTICAL_PRESENTATION,
|
||||
HORIZONTAL_PRESENTATION
|
||||
HORIZONTAL_PRESENTATION,
|
||||
CUSTOM
|
||||
}
|
||||
|
|
|
@ -1,42 +1,54 @@
|
|||
package io.openvidu.java.client;
|
||||
|
||||
public class RecordingProperties {
|
||||
|
||||
|
||||
private String name;
|
||||
private RecordingLayout recordingLayout;
|
||||
|
||||
private String customLayout;
|
||||
|
||||
public static class Builder {
|
||||
|
||||
private String name = "";
|
||||
private RecordingLayout recordingLayout;
|
||||
private String customLayout;
|
||||
|
||||
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) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public RecordingProperties.Builder recordingLayout(RecordingLayout layout) {
|
||||
this.recordingLayout = layout;
|
||||
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.recordingLayout = layout;
|
||||
this.customLayout = customLayout;
|
||||
}
|
||||
|
||||
|
||||
public String name() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
|
||||
public RecordingLayout 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);
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("defaultRecordingLayout", properties.defaultRecordingLayout().name());
|
||||
json.put("recordingMode", properties.recordingMode().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());
|
||||
|
||||
request.setHeader(HttpHeaders.CONTENT_TYPE, "application/json");
|
||||
|
|
|
@ -5,15 +5,18 @@ public class SessionProperties {
|
|||
private MediaMode mediaMode;
|
||||
private RecordingMode recordingMode;
|
||||
private RecordingLayout defaultRecordingLayout;
|
||||
private String defaultCustomLayout;
|
||||
|
||||
public static class Builder {
|
||||
|
||||
private MediaMode mediaMode = MediaMode.ROUTED;
|
||||
private RecordingMode recordingMode = RecordingMode.MANUAL;
|
||||
private RecordingLayout defaultRecordingLayout = RecordingLayout.BEST_FIT;
|
||||
private String defaultCustomLayout = "";
|
||||
|
||||
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) {
|
||||
|
@ -31,18 +34,26 @@ public class SessionProperties {
|
|||
return this;
|
||||
}
|
||||
|
||||
public SessionProperties.Builder defaultCustomLayout(String path) {
|
||||
this.defaultCustomLayout = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected SessionProperties() {
|
||||
this.mediaMode = MediaMode.ROUTED;
|
||||
this.recordingMode = RecordingMode.MANUAL;
|
||||
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.recordingMode = recordingMode;
|
||||
this.defaultRecordingLayout = layout;
|
||||
this.defaultCustomLayout = defaultCustomLayout;
|
||||
}
|
||||
|
||||
public RecordingMode recordingMode() {
|
||||
|
@ -57,4 +68,8 @@ public class SessionProperties {
|
|||
return this.defaultRecordingLayout;
|
||||
}
|
||||
|
||||
public String defaultCustomLayout() {
|
||||
return this.defaultCustomLayout;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue