mirror of https://github.com/OpenVidu/openvidu.git
openvidu-java-client/openvidu-node-client: new RecordingProperties defaults
parent
1d026e4a7d
commit
e38c7e4a6c
|
@ -196,26 +196,8 @@ public class OpenVidu {
|
|||
|
||||
HttpPost request = new HttpPost(this.hostname + API_RECORDINGS_START);
|
||||
|
||||
JsonObject json = new JsonObject();
|
||||
JsonObject json = properties.toJson();
|
||||
json.addProperty("session", sessionId);
|
||||
json.addProperty("name", properties.name());
|
||||
json.addProperty("outputMode", properties.outputMode() != null ? properties.outputMode().name() : null);
|
||||
json.addProperty("hasAudio", properties.hasAudio());
|
||||
json.addProperty("hasVideo", properties.hasVideo());
|
||||
json.addProperty("shmSize", properties.shmSize());
|
||||
json.addProperty("mediaNode", properties.mediaNode());
|
||||
|
||||
if ((properties.outputMode() == null || Recording.OutputMode.COMPOSED.equals(properties.outputMode())
|
||||
|| (Recording.OutputMode.COMPOSED_QUICK_START.equals(properties.outputMode())))
|
||||
&& properties.hasVideo()) {
|
||||
json.addProperty("resolution", properties.resolution());
|
||||
json.addProperty("frameRate", properties.frameRate());
|
||||
json.addProperty("recordingLayout",
|
||||
(properties.recordingLayout() != null) ? properties.recordingLayout().name() : "");
|
||||
if (RecordingLayout.CUSTOM.equals(properties.recordingLayout())) {
|
||||
json.addProperty("customLayout", (properties.customLayout() != null) ? properties.customLayout() : "");
|
||||
}
|
||||
}
|
||||
|
||||
StringEntity params = null;
|
||||
try {
|
||||
|
|
|
@ -159,6 +159,22 @@ public class Recording {
|
|||
return this.recordingProperties.name();
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>true</code> if the recording has an audio track, <code>false</code>
|
||||
* otherwise (currently fixed to true)
|
||||
*/
|
||||
public boolean hasAudio() {
|
||||
return this.recordingProperties.hasAudio();
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>true</code> if the recording has a video track, <code>false</code>
|
||||
* otherwise (currently fixed to true)
|
||||
*/
|
||||
public boolean hasVideo() {
|
||||
return this.recordingProperties.hasVideo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mode of recording: COMPOSED for a single archive in a grid layout or
|
||||
* INDIVIDUAL for one archive for each stream
|
||||
|
@ -249,24 +265,8 @@ public class Recording {
|
|||
* {@link io.openvidu.java.client.Recording.OutputMode#COMPOSED_QUICK_START} and
|
||||
* {@link Recording#hasVideo()} is true
|
||||
*/
|
||||
public int getFrameRate() {
|
||||
public Integer getFrameRate() {
|
||||
return this.recordingProperties.frameRate();
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>true</code> if the recording has an audio track, <code>false</code>
|
||||
* otherwise (currently fixed to true)
|
||||
*/
|
||||
public boolean hasAudio() {
|
||||
return this.recordingProperties.hasAudio();
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>true</code> if the recording has a video track, <code>false</code>
|
||||
* otherwise (currently fixed to true)
|
||||
*/
|
||||
public boolean hasVideo() {
|
||||
return this.recordingProperties.hasVideo();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,15 +27,29 @@ import io.openvidu.java.client.Recording.OutputMode;
|
|||
*/
|
||||
public class RecordingProperties {
|
||||
|
||||
private String name;
|
||||
private Recording.OutputMode outputMode;
|
||||
public static class DefaultValues {
|
||||
public static final Boolean hasAudio = true;
|
||||
public static final Boolean hasVideo = true;
|
||||
public static final Recording.OutputMode outputMode = Recording.OutputMode.COMPOSED;
|
||||
public static final RecordingLayout recordingLayout = RecordingLayout.BEST_FIT;
|
||||
public static final String resolution = "1280x720";
|
||||
public static final Integer frameRate = 25;
|
||||
public static final Long shmSize = 536870912L;
|
||||
}
|
||||
|
||||
// For all
|
||||
private String name = "";
|
||||
private Boolean hasAudio = true;
|
||||
private Boolean hasVideo = true;
|
||||
private Recording.OutputMode outputMode = Recording.OutputMode.COMPOSED;
|
||||
// For COMPOSED/COMPOSED_QUICK_START + hasVideo
|
||||
private RecordingLayout recordingLayout;
|
||||
private String customLayout;
|
||||
private String resolution;
|
||||
private int frameRate;
|
||||
private boolean hasAudio;
|
||||
private boolean hasVideo;
|
||||
private long shmSize; // For COMPOSED recording
|
||||
private Integer frameRate;
|
||||
private Long shmSize;
|
||||
// For COMPOSED/COMPOSED_QUICK_START + hasVideo + RecordingLayout.CUSTOM
|
||||
private String customLayout;
|
||||
// For OpenVidu Pro
|
||||
private String mediaNode;
|
||||
|
||||
/**
|
||||
|
@ -44,14 +58,14 @@ public class RecordingProperties {
|
|||
public static class Builder {
|
||||
|
||||
private String name = "";
|
||||
private Boolean hasAudio = true;
|
||||
private Boolean hasVideo = true;
|
||||
private Recording.OutputMode outputMode = Recording.OutputMode.COMPOSED;
|
||||
private RecordingLayout recordingLayout = RecordingLayout.BEST_FIT;
|
||||
private String customLayout = "";
|
||||
private String resolution = "1280x720";
|
||||
private int frameRate = 25;
|
||||
private boolean hasAudio = true;
|
||||
private boolean hasVideo = true;
|
||||
private long shmSize = 536870912L;
|
||||
private RecordingLayout recordingLayout;
|
||||
private String resolution;
|
||||
private Integer frameRate;
|
||||
private Long shmSize;
|
||||
private String customLayout;
|
||||
private String mediaNode;
|
||||
|
||||
public Builder() {
|
||||
|
@ -59,14 +73,14 @@ public class RecordingProperties {
|
|||
|
||||
public Builder(RecordingProperties props) {
|
||||
this.name = props.name();
|
||||
this.outputMode = props.outputMode();
|
||||
this.recordingLayout = props.recordingLayout();
|
||||
this.customLayout = props.customLayout();
|
||||
this.resolution = props.resolution();
|
||||
this.frameRate = props.frameRate();
|
||||
this.hasAudio = props.hasAudio();
|
||||
this.hasVideo = props.hasVideo();
|
||||
this.outputMode = props.outputMode();
|
||||
this.recordingLayout = props.recordingLayout();
|
||||
this.resolution = props.resolution();
|
||||
this.frameRate = props.frameRate();
|
||||
this.shmSize = props.shmSize();
|
||||
this.customLayout = props.customLayout();
|
||||
this.mediaNode = props.mediaNode();
|
||||
}
|
||||
|
||||
|
@ -74,8 +88,9 @@ public class RecordingProperties {
|
|||
* Builder for {@link io.openvidu.java.client.RecordingProperties}
|
||||
*/
|
||||
public RecordingProperties build() {
|
||||
return new RecordingProperties(this.name, this.outputMode, this.recordingLayout, this.customLayout,
|
||||
this.resolution, this.frameRate, this.hasAudio, this.hasVideo, this.shmSize, this.mediaNode);
|
||||
return new RecordingProperties(this.name, this.hasAudio, this.hasVideo, this.outputMode,
|
||||
this.recordingLayout, this.resolution, this.frameRate, this.shmSize, this.customLayout,
|
||||
this.mediaNode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -86,6 +101,26 @@ public class RecordingProperties {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method to specify whether to record audio or not. Cannot be set to
|
||||
* false at the same time as
|
||||
* {@link RecordingProperties.Builder#hasVideo(boolean)}
|
||||
*/
|
||||
public RecordingProperties.Builder hasAudio(boolean hasAudio) {
|
||||
this.hasAudio = hasAudio;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method to specify whether to record video or not. Cannot be set to
|
||||
* false at the same time as
|
||||
* {@link RecordingProperties.Builder#hasAudio(boolean)}
|
||||
*/
|
||||
public RecordingProperties.Builder hasVideo(boolean hasVideo) {
|
||||
this.hasVideo = hasVideo;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method to set the mode of recording:
|
||||
* {@link Recording.OutputMode#COMPOSED} or
|
||||
|
@ -109,21 +144,6 @@ public class RecordingProperties {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If setting
|
||||
* {@link io.openvidu.java.client.RecordingProperties.Builder#recordingLayout(RecordingLayout)}
|
||||
* to {@link io.openvidu.java.client.RecordingLayout#CUSTOM} you can call this
|
||||
* method to set the relative path to the specific custom layout you want to
|
||||
* use.<br>
|
||||
* See <a href=
|
||||
* "https://docs.openvidu.io/en/stable/advanced-features/recording#custom-recording-layouts"
|
||||
* target="_blank">Custom recording layouts</a> to learn more
|
||||
*/
|
||||
public RecordingProperties.Builder customLayout(String path) {
|
||||
this.customLayout = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method to specify the recording resolution. Must be a string with
|
||||
* format "WIDTHxHEIGHT", being both WIDTH and HEIGHT the number of pixels
|
||||
|
@ -157,26 +177,6 @@ public class RecordingProperties {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method to specify whether to record audio or not. Cannot be set to
|
||||
* false at the same time as
|
||||
* {@link RecordingProperties.Builder#hasVideo(boolean)}
|
||||
*/
|
||||
public RecordingProperties.Builder hasAudio(boolean hasAudio) {
|
||||
this.hasAudio = hasAudio;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method to specify whether to record video or not. Cannot be set to
|
||||
* false at the same time as
|
||||
* {@link RecordingProperties.Builder#hasAudio(boolean)}
|
||||
*/
|
||||
public RecordingProperties.Builder hasVideo(boolean hasVideo) {
|
||||
this.hasVideo = hasVideo;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method to specify the amount of shared memory reserved for the
|
||||
* recording process in bytes. Minimum 134217728 (128MB).<br>
|
||||
|
@ -191,6 +191,21 @@ public class RecordingProperties {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If setting
|
||||
* {@link io.openvidu.java.client.RecordingProperties.Builder#recordingLayout(RecordingLayout)}
|
||||
* to {@link io.openvidu.java.client.RecordingLayout#CUSTOM} you can call this
|
||||
* method to set the relative path to the specific custom layout you want to
|
||||
* use.<br>
|
||||
* See <a href=
|
||||
* "https://docs.openvidu.io/en/stable/advanced-features/recording#custom-recording-layouts"
|
||||
* target="_blank">Custom recording layouts</a> to learn more
|
||||
*/
|
||||
public RecordingProperties.Builder customLayout(String path) {
|
||||
this.customLayout = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <a href="https://docs.openvidu.io/en/stable/openvidu-pro/" target="_blank"
|
||||
* style="display: inline-block; background-color: rgb(0, 136, 170); color:
|
||||
|
@ -210,18 +225,23 @@ public class RecordingProperties {
|
|||
|
||||
}
|
||||
|
||||
protected RecordingProperties(String name, Recording.OutputMode outputMode, RecordingLayout layout,
|
||||
String customLayout, String resolution, int frameRate, boolean hasAudio, boolean hasVideo, long shmSize,
|
||||
protected RecordingProperties(String name, Boolean hasAudio, Boolean hasVideo, Recording.OutputMode outputMode,
|
||||
RecordingLayout layout, String resolution, Integer frameRate, Long shmSize, String customLayout,
|
||||
String mediaNode) {
|
||||
this.name = name;
|
||||
this.outputMode = outputMode;
|
||||
this.recordingLayout = layout;
|
||||
this.customLayout = customLayout;
|
||||
this.resolution = resolution;
|
||||
this.frameRate = frameRate;
|
||||
this.hasAudio = hasAudio;
|
||||
this.hasVideo = hasVideo;
|
||||
this.shmSize = shmSize;
|
||||
this.name = name != null ? name : "";
|
||||
this.hasAudio = hasAudio != null ? hasAudio : DefaultValues.hasAudio;
|
||||
this.hasVideo = hasVideo != null ? hasVideo : DefaultValues.hasVideo;
|
||||
this.outputMode = outputMode != null ? outputMode : DefaultValues.outputMode;
|
||||
if ((OutputMode.COMPOSED.equals(this.outputMode) || OutputMode.COMPOSED_QUICK_START.equals(this.outputMode))
|
||||
&& this.hasVideo) {
|
||||
this.recordingLayout = layout != null ? layout : DefaultValues.recordingLayout;
|
||||
this.resolution = resolution != null ? resolution : DefaultValues.resolution;
|
||||
this.frameRate = frameRate != null ? frameRate : DefaultValues.frameRate;
|
||||
this.shmSize = shmSize != null ? shmSize : DefaultValues.shmSize;
|
||||
if (RecordingLayout.CUSTOM.equals(this.recordingLayout)) {
|
||||
this.customLayout = customLayout;
|
||||
}
|
||||
}
|
||||
this.mediaNode = mediaNode;
|
||||
}
|
||||
|
||||
|
@ -232,6 +252,28 @@ public class RecordingProperties {
|
|||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines whether to record audio or not. Cannot be set to false at the same
|
||||
* time as {@link RecordingProperties#hasVideo()}.<br>
|
||||
* <br>
|
||||
*
|
||||
* Default to true
|
||||
*/
|
||||
public Boolean hasAudio() {
|
||||
return this.hasAudio;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines whether to record video or not. Cannot be set to false at the same
|
||||
* time as {@link RecordingProperties#hasAudio()}.<br>
|
||||
* <br>
|
||||
*
|
||||
* Default to true
|
||||
*/
|
||||
public Boolean hasVideo() {
|
||||
return this.hasVideo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the mode of recording: {@link Recording.OutputMode#COMPOSED} or
|
||||
* {@link io.openvidu.java.client.Recording.OutputMode#COMPOSED_QUICK_START} for
|
||||
|
@ -260,18 +302,6 @@ public class RecordingProperties {
|
|||
return this.recordingLayout;
|
||||
}
|
||||
|
||||
/**
|
||||
* If {@link io.openvidu.java.client.RecordingProperties#recordingLayout()} is
|
||||
* set to {@link io.openvidu.java.client.RecordingLayout#CUSTOM}, this property
|
||||
* defines the relative path to the specific custom layout you want to use.<br>
|
||||
* See <a href=
|
||||
* "https://docs.openvidu.io/en/stable/advanced-features/recording#custom-recording-layouts"
|
||||
* target="_blank">Custom recording layouts</a> to learn more
|
||||
*/
|
||||
public String customLayout() {
|
||||
return this.customLayout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the resolution of the recorded video.<br>
|
||||
* Will only have effect for
|
||||
|
@ -304,32 +334,10 @@ public class RecordingProperties {
|
|||
*
|
||||
* Default to 25
|
||||
*/
|
||||
public int frameRate() {
|
||||
public Integer frameRate() {
|
||||
return this.frameRate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines whether to record audio or not. Cannot be set to false at the same
|
||||
* time as {@link RecordingProperties#hasVideo()}.<br>
|
||||
* <br>
|
||||
*
|
||||
* Default to true
|
||||
*/
|
||||
public boolean hasAudio() {
|
||||
return this.hasAudio;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines whether to record video or not. Cannot be set to false at the same
|
||||
* time as {@link RecordingProperties#hasAudio()}.<br>
|
||||
* <br>
|
||||
*
|
||||
* Default to true
|
||||
*/
|
||||
public boolean hasVideo() {
|
||||
return this.hasVideo;
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount of shared memory reserved for the recording process in bytes.
|
||||
* Minimum 134217728 (128MB).<br>
|
||||
|
@ -342,10 +350,22 @@ public class RecordingProperties {
|
|||
*
|
||||
* Default to 536870912 (512 MB)
|
||||
*/
|
||||
public long shmSize() {
|
||||
public Long shmSize() {
|
||||
return this.shmSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* If {@link io.openvidu.java.client.RecordingProperties#recordingLayout()} is
|
||||
* set to {@link io.openvidu.java.client.RecordingLayout#CUSTOM}, this property
|
||||
* defines the relative path to the specific custom layout you want to use.<br>
|
||||
* See <a href=
|
||||
* "https://docs.openvidu.io/en/stable/advanced-features/recording#custom-recording-layouts"
|
||||
* target="_blank">Custom recording layouts</a> to learn more
|
||||
*/
|
||||
public String customLayout() {
|
||||
return this.customLayout;
|
||||
}
|
||||
|
||||
/**
|
||||
* <a href="https://docs.openvidu.io/en/stable/openvidu-pro/" target="_blank"
|
||||
* style="display: inline-block; background-color: rgb(0, 136, 170); color:
|
||||
|
@ -367,17 +387,19 @@ public class RecordingProperties {
|
|||
public JsonObject toJson() {
|
||||
JsonObject json = new JsonObject();
|
||||
json.addProperty("name", name);
|
||||
json.addProperty("outputMode", outputMode.name());
|
||||
json.addProperty("hasAudio", hasAudio);
|
||||
json.addProperty("hasVideo", hasVideo);
|
||||
if (OutputMode.COMPOSED.equals(outputMode) || OutputMode.COMPOSED_QUICK_START.equals(outputMode)) {
|
||||
json.addProperty("recordingLayout", recordingLayout.name());
|
||||
json.addProperty("hasAudio", hasAudio != null ? hasAudio : DefaultValues.hasAudio);
|
||||
json.addProperty("hasVideo", hasVideo != null ? hasVideo : DefaultValues.hasVideo);
|
||||
json.addProperty("outputMode", outputMode != null ? outputMode.name() : DefaultValues.outputMode.name());
|
||||
if ((OutputMode.COMPOSED.equals(outputMode) || OutputMode.COMPOSED_QUICK_START.equals(outputMode))
|
||||
&& hasVideo) {
|
||||
json.addProperty("recordingLayout",
|
||||
recordingLayout != null ? recordingLayout.name() : DefaultValues.recordingLayout.name());
|
||||
json.addProperty("resolution", resolution != null ? resolution : DefaultValues.resolution);
|
||||
json.addProperty("frameRate", frameRate != null ? frameRate : DefaultValues.frameRate);
|
||||
json.addProperty("shmSize", shmSize != null ? shmSize : DefaultValues.shmSize);
|
||||
if (RecordingLayout.CUSTOM.equals(recordingLayout)) {
|
||||
json.addProperty("customLayout", customLayout);
|
||||
json.addProperty("customLayout", customLayout != null ? customLayout : "");
|
||||
}
|
||||
json.addProperty("resolution", resolution);
|
||||
json.addProperty("frameRate", frameRate);
|
||||
json.addProperty("shmSize", shmSize);
|
||||
}
|
||||
if (this.mediaNode != null) {
|
||||
json.addProperty("mediaNode", mediaNode);
|
||||
|
@ -386,33 +408,46 @@ public class RecordingProperties {
|
|||
}
|
||||
|
||||
public static RecordingProperties fromJson(JsonObject json) {
|
||||
|
||||
Boolean hasVideoAux = true;
|
||||
Recording.OutputMode outputModeAux = null;
|
||||
RecordingLayout recordingLayoutAux = null;
|
||||
|
||||
Builder builder = new RecordingProperties.Builder();
|
||||
if (json.has("name")) {
|
||||
builder.name(json.get("name").getAsString());
|
||||
}
|
||||
if (json.has("outputMode")) {
|
||||
builder.outputMode(OutputMode.valueOf(json.get("outputMode").getAsString()));
|
||||
}
|
||||
if (json.has("recordingLayout")) {
|
||||
builder.recordingLayout(RecordingLayout.valueOf(json.get("recordingLayout").getAsString()));
|
||||
}
|
||||
if (json.has("customLayout")) {
|
||||
builder.customLayout(json.get("customLayout").getAsString());
|
||||
}
|
||||
if (json.has("resolution")) {
|
||||
builder.resolution(json.get("resolution").getAsString());
|
||||
}
|
||||
if (json.has("frameRate")) {
|
||||
builder.frameRate(json.get("frameRate").getAsInt());
|
||||
}
|
||||
if (json.has("hasAudio")) {
|
||||
builder.hasAudio(json.get("hasAudio").getAsBoolean());
|
||||
}
|
||||
if (json.has("hasVideo")) {
|
||||
builder.hasVideo(json.get("hasVideo").getAsBoolean());
|
||||
hasVideoAux = json.get("hasVideo").getAsBoolean();
|
||||
builder.hasVideo(hasVideoAux);
|
||||
}
|
||||
if (json.has("shmSize")) {
|
||||
builder.shmSize(json.get("shmSize").getAsLong());
|
||||
if (json.has("outputMode")) {
|
||||
outputModeAux = OutputMode.valueOf(json.get("outputMode").getAsString());
|
||||
builder.outputMode(outputModeAux);
|
||||
}
|
||||
if ((OutputMode.COMPOSED.equals(outputModeAux) || OutputMode.COMPOSED_QUICK_START.equals(outputModeAux))
|
||||
&& hasVideoAux) {
|
||||
if (json.has("recordingLayout")) {
|
||||
recordingLayoutAux = RecordingLayout.valueOf(json.get("recordingLayout").getAsString());
|
||||
builder.recordingLayout(recordingLayoutAux);
|
||||
}
|
||||
if (json.has("resolution")) {
|
||||
builder.resolution(json.get("resolution").getAsString());
|
||||
}
|
||||
if (json.has("frameRate")) {
|
||||
builder.frameRate(json.get("frameRate").getAsInt());
|
||||
}
|
||||
if (json.has("shmSize")) {
|
||||
builder.shmSize(json.get("shmSize").getAsLong());
|
||||
}
|
||||
if (RecordingLayout.CUSTOM.equals(recordingLayoutAux)) {
|
||||
if (json.has("customLayout")) {
|
||||
builder.customLayout(json.get("customLayout").getAsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (json.has("mediaNode")) {
|
||||
builder.mediaNode(json.get("mediaNode").getAsString());
|
||||
|
|
|
@ -77,17 +77,21 @@ export class Recording {
|
|||
this.url = json['url'];
|
||||
this.status = json['status'];
|
||||
this.properties = {
|
||||
name: !!(json['name']) ? json['name'] : this.id,
|
||||
outputMode: !!(json['outputMode']) ? json['outputMode'] : Recording.OutputMode.COMPOSED,
|
||||
hasAudio: !!(json['hasAudio']),
|
||||
hasVideo: !!json['hasVideo']
|
||||
name: (json['name'] != null) ? json['name'] : this.id,
|
||||
hasAudio: (json['hasAudio'] != null) ? !!json['hasAudio'] : Recording.DefaultRecordingPropertiesValues.hasAudio,
|
||||
hasVideo: (json['hasVideo'] != null) ? !!json['hasVideo'] : Recording.DefaultRecordingPropertiesValues.hasVideo,
|
||||
outputMode: (json['outputMode'] != null) ? json['outputMode'] : Recording.DefaultRecordingPropertiesValues.outputMode,
|
||||
mediaNode: json['mediaNode']
|
||||
};
|
||||
if (this.properties.outputMode.toString() === Recording.OutputMode[Recording.OutputMode.COMPOSED]
|
||||
|| this.properties.outputMode.toString() === Recording.OutputMode[Recording.OutputMode.COMPOSED_QUICK_START]) {
|
||||
this.properties.resolution = !!(json['resolution']) ? json['resolution'] : '1280x720';
|
||||
this.properties.recordingLayout = !!(json['recordingLayout']) ? json['recordingLayout'] : RecordingLayout.BEST_FIT;
|
||||
if ((this.properties.outputMode.toString() === Recording.OutputMode[Recording.OutputMode.COMPOSED]
|
||||
|| this.properties.outputMode.toString() === Recording.OutputMode[Recording.OutputMode.COMPOSED_QUICK_START])
|
||||
&& this.properties.hasVideo) {
|
||||
this.properties.recordingLayout = (json['recordingLayout'] != null) ? json['recordingLayout'] : Recording.DefaultRecordingPropertiesValues.recordingLayout;
|
||||
this.properties.resolution = (json['resolution'] != null) ? json['resolution'] : Recording.DefaultRecordingPropertiesValues.resolution;
|
||||
this.properties.frameRate = (json['frameRate'] != null) ? Number(json['frameRate']) : Recording.DefaultRecordingPropertiesValues.frameRate;
|
||||
this.properties.shmSize = (json['shmSize'] != null) ? Number(json['shmSize']) : Recording.DefaultRecordingPropertiesValues.shmSize;
|
||||
if (this.properties.recordingLayout.toString() === RecordingLayout[RecordingLayout.CUSTOM]) {
|
||||
this.properties.customLayout = json['customLayout'];
|
||||
this.properties.customLayout = (json['customLayout'] != null) ? json['customLayout'] : '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -165,4 +169,18 @@ export namespace Recording {
|
|||
*/
|
||||
INDIVIDUAL = 'INDIVIDUAL'
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export class DefaultRecordingPropertiesValues {
|
||||
static readonly hasAudio: boolean = true;
|
||||
static readonly hasVideo: boolean = true;
|
||||
static readonly outputMode: Recording.OutputMode = Recording.OutputMode.COMPOSED;
|
||||
static readonly recordingLayout: RecordingLayout = RecordingLayout.BEST_FIT;
|
||||
static readonly resolution: string = "1280x720";
|
||||
static readonly frameRate: number = 25;
|
||||
static readonly shmSize: number = 536870912;
|
||||
}
|
||||
|
||||
}
|
|
@ -30,6 +30,20 @@ export interface RecordingProperties {
|
|||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* Whether or not to record audio. Cannot be set to false at the same time as [[RecordingProperties.hasVideo]]
|
||||
*
|
||||
* Default to true
|
||||
*/
|
||||
hasAudio?: boolean;
|
||||
|
||||
/**
|
||||
* Whether or not to record video. Cannot be set to false at the same time as [[RecordingProperties.hasAudio]]
|
||||
*
|
||||
* Default to true
|
||||
*/
|
||||
hasVideo?: boolean;
|
||||
|
||||
/**
|
||||
* The mode of recording: COMPOSED for a single archive in a grid layout or INDIVIDUAL for one archive for each stream
|
||||
*
|
||||
|
@ -45,13 +59,6 @@ export interface RecordingProperties {
|
|||
*/
|
||||
recordingLayout?: RecordingLayout;
|
||||
|
||||
/**
|
||||
* The relative path to the specific custom layout you want to use.<br>
|
||||
* Will only have effect if [[RecordingProperties.outputMode]] is `COMPOSED` (or `COMPOSED_QUICK_START`) and [[RecordingProperties.recordingLayout]] is `CUSTOM`<br>
|
||||
* See [Custom recording layouts](/en/stable/advanced-features/recording#custom-recording-layouts) to learn more.
|
||||
*/
|
||||
customLayout?: string;
|
||||
|
||||
/**
|
||||
* Recording video file resolution. Must be a string with format "WIDTHxHEIGHT",
|
||||
* being both WIDTH and HEIGHT the number of pixels between 100 and 1999.<br>
|
||||
|
@ -72,20 +79,6 @@ export interface RecordingProperties {
|
|||
*/
|
||||
frameRate?: number;
|
||||
|
||||
/**
|
||||
* Whether or not to record audio. Cannot be set to false at the same time as [[RecordingProperties.hasVideo]]
|
||||
*
|
||||
* Default to true
|
||||
*/
|
||||
hasAudio?: boolean;
|
||||
|
||||
/**
|
||||
* Whether or not to record video. Cannot be set to false at the same time as [[RecordingProperties.hasAudio]]
|
||||
*
|
||||
* Default to true
|
||||
*/
|
||||
hasVideo?: boolean;
|
||||
|
||||
/**
|
||||
* The amount of shared memory reserved for the recording process in bytes.
|
||||
* Will only have effect if [[RecordingProperties.outputMode]] is set to [[Recording.OutputMode.COMPOSED]] or [[Recording.OutputMode.COMPOSED_QUICK_START]]
|
||||
|
@ -96,6 +89,13 @@ export interface RecordingProperties {
|
|||
*/
|
||||
shmSize?: number;
|
||||
|
||||
/**
|
||||
* The relative path to the specific custom layout you want to use.<br>
|
||||
* Will only have effect if [[RecordingProperties.outputMode]] is `COMPOSED` (or `COMPOSED_QUICK_START`) and [[RecordingProperties.recordingLayout]] is `CUSTOM`<br>
|
||||
* See [Custom recording layouts](/en/stable/advanced-features/recording#custom-recording-layouts) to learn more.
|
||||
*/
|
||||
customLayout?: string;
|
||||
|
||||
/**
|
||||
* **This feature is part of OpenVidu Pro tier** <a href="https://docs.openvidu.io/en/stable/openvidu-pro/" target="_blank" style="display: inline-block; background-color: rgb(0, 136, 170); color: white; font-weight: bold; padding: 0px 5px; margin-right: 5px; border-radius: 3px; font-size: 13px; line-height:21px; font-family: Montserrat, sans-serif">PRO</a>
|
||||
*
|
||||
|
|
|
@ -656,17 +656,21 @@ export class Session {
|
|||
this.properties.mediaMode = !!this.properties.mediaMode ? this.properties.mediaMode : MediaMode.ROUTED;
|
||||
this.properties.recordingMode = !!this.properties.recordingMode ? this.properties.recordingMode : RecordingMode.MANUAL;
|
||||
this.properties.defaultRecordingProperties = {
|
||||
name: !!this.properties.defaultRecordingProperties?.name ? this.properties.defaultRecordingProperties?.name : '',
|
||||
outputMode: !!this.properties.defaultRecordingProperties?.outputMode ? this.properties.defaultRecordingProperties?.outputMode : Recording.OutputMode.COMPOSED,
|
||||
recordingLayout: !!this.properties.defaultRecordingProperties?.recordingLayout ? this.properties.defaultRecordingProperties?.recordingLayout : RecordingLayout.BEST_FIT,
|
||||
customLayout: !!this.properties.defaultRecordingProperties?.customLayout ? this.properties.defaultRecordingProperties?.customLayout : '',
|
||||
resolution: !!this.properties.defaultRecordingProperties?.resolution ? this.properties.defaultRecordingProperties?.resolution : '1280x720',
|
||||
frameRate: !!this.properties.defaultRecordingProperties?.frameRate ? this.properties.defaultRecordingProperties?.frameRate : 25,
|
||||
hasAudio: !!this.properties.defaultRecordingProperties?.hasAudio ? this.properties.defaultRecordingProperties?.hasAudio : true,
|
||||
hasVideo: !!this.properties.defaultRecordingProperties?.hasVideo ? this.properties.defaultRecordingProperties?.hasVideo : true,
|
||||
shmSize: !!this.properties.defaultRecordingProperties?.shmSize ? this.properties.defaultRecordingProperties?.shmSize : 536870912,
|
||||
name: !!this.properties.defaultRecordingProperties?.name ? this.properties.defaultRecordingProperties.name : '',
|
||||
hasAudio: !!this.properties.defaultRecordingProperties?.hasAudio ? this.properties.defaultRecordingProperties.hasAudio : true,
|
||||
hasVideo: !!this.properties.defaultRecordingProperties?.hasVideo ? this.properties.defaultRecordingProperties.hasVideo : true,
|
||||
outputMode: !!this.properties.defaultRecordingProperties?.outputMode ? this.properties.defaultRecordingProperties.outputMode : Recording.OutputMode.COMPOSED,
|
||||
mediaNode: this.properties.defaultRecordingProperties?.mediaNode
|
||||
};
|
||||
if ((this.properties.defaultRecordingProperties.outputMode === Recording.OutputMode.COMPOSED || this.properties.defaultRecordingProperties.outputMode == Recording.OutputMode.COMPOSED_QUICK_START) && this.properties.defaultRecordingProperties.hasVideo) {
|
||||
this.properties.defaultRecordingProperties.recordingLayout = !!this.properties.defaultRecordingProperties.recordingLayout ? this.properties.defaultRecordingProperties.recordingLayout : RecordingLayout.BEST_FIT;
|
||||
this.properties.defaultRecordingProperties.resolution = !!this.properties.defaultRecordingProperties.resolution ? this.properties.defaultRecordingProperties.resolution : '1280x720';
|
||||
this.properties.defaultRecordingProperties.frameRate = !!this.properties.defaultRecordingProperties.frameRate ? this.properties.defaultRecordingProperties.frameRate : 25;
|
||||
this.properties.defaultRecordingProperties.shmSize = !!this.properties.defaultRecordingProperties.shmSize ? this.properties.defaultRecordingProperties.shmSize : 536870912;
|
||||
if (this.properties.defaultRecordingProperties.recordingLayout === RecordingLayout.CUSTOM) {
|
||||
this.properties.defaultRecordingProperties.customLayout = !!this.properties.defaultRecordingProperties.customLayout ? this.properties.defaultRecordingProperties.customLayout : '';
|
||||
}
|
||||
}
|
||||
this.properties.customSessionId = !!this.properties.customSessionId ? this.properties.customSessionId : '';
|
||||
this.properties.mediaNode = !!this.properties.mediaNode ? this.properties.mediaNode : undefined;
|
||||
this.properties.forcedVideoCodec = !!this.properties.forcedVideoCodec ? this.properties.forcedVideoCodec : VideoCodec.VP8;
|
||||
|
|
Loading…
Reference in New Issue