openvidu-java-client: do not define RecordingLayout and CustomLayout unless conditions are met

pull/203/head
pabloFuente 2019-02-11 16:10:14 +01:00
parent 8fc1f500f5
commit 147727bccd
1 changed files with 9 additions and 5 deletions

View File

@ -40,8 +40,8 @@ public class RecordingProperties {
private String name = ""; private String name = "";
private Recording.OutputMode outputMode = Recording.OutputMode.COMPOSED; private Recording.OutputMode outputMode = Recording.OutputMode.COMPOSED;
private RecordingLayout recordingLayout = RecordingLayout.BEST_FIT; private RecordingLayout recordingLayout;
private String customLayout = ""; private String customLayout;
private String resolution; private String resolution;
private boolean hasAudio = true; private boolean hasAudio = true;
private boolean hasVideo = true; private boolean hasVideo = true;
@ -50,9 +50,13 @@ public class RecordingProperties {
* Builder for {@link io.openvidu.java.client.RecordingProperties} * Builder for {@link io.openvidu.java.client.RecordingProperties}
*/ */
public RecordingProperties build() { public RecordingProperties build() {
this.resolution = (this.resolution == null) if (OutputMode.COMPOSED.equals(this.outputMode)) {
? (OutputMode.COMPOSED.equals(this.outputMode) ? "1920x1080" : null) this.recordingLayout = this.recordingLayout != null ? this.recordingLayout : RecordingLayout.BEST_FIT;
: this.resolution; this.resolution = this.resolution != null ? this.resolution : "1920x1080";
if (RecordingLayout.CUSTOM.equals(this.recordingLayout)) {
this.customLayout = this.customLayout != null ? this.customLayout : "";
}
}
return new RecordingProperties(this.name, this.outputMode, this.recordingLayout, this.customLayout, return new RecordingProperties(this.name, this.outputMode, this.recordingLayout, this.customLayout,
this.resolution, this.hasAudio, this.hasVideo); this.resolution, this.hasAudio, this.hasVideo);
} }