SDKs: SessionProperties#mediaNode

pull/553/head
pabloFuente 2020-10-23 22:10:15 +02:00
parent 8ddd9bfc1b
commit e384a07063
2 changed files with 46 additions and 7 deletions

View File

@ -30,6 +30,7 @@ public class SessionProperties {
private RecordingLayout defaultRecordingLayout; private RecordingLayout defaultRecordingLayout;
private String defaultCustomLayout; private String defaultCustomLayout;
private String customSessionId; private String customSessionId;
private String mediaNode;
/** /**
* Builder for {@link io.openvidu.java.client.SessionProperties} * Builder for {@link io.openvidu.java.client.SessionProperties}
@ -42,6 +43,7 @@ public class SessionProperties {
private RecordingLayout defaultRecordingLayout = RecordingLayout.BEST_FIT; private RecordingLayout defaultRecordingLayout = RecordingLayout.BEST_FIT;
private String defaultCustomLayout = ""; private String defaultCustomLayout = "";
private String customSessionId = ""; private String customSessionId = "";
private String mediaNode;
/** /**
* Returns the {@link io.openvidu.java.client.SessionProperties} object properly * Returns the {@link io.openvidu.java.client.SessionProperties} object properly
@ -49,7 +51,7 @@ public class SessionProperties {
*/ */
public SessionProperties build() { public SessionProperties build() {
return new SessionProperties(this.mediaMode, this.recordingMode, this.defaultOutputMode, return new SessionProperties(this.mediaMode, this.recordingMode, this.defaultOutputMode,
this.defaultRecordingLayout, this.defaultCustomLayout, this.customSessionId); this.defaultRecordingLayout, this.defaultCustomLayout, this.customSessionId, this.mediaNode);
} }
/** /**
@ -118,8 +120,8 @@ public class SessionProperties {
* *
* Custom layouts are only applicable to recordings with OutputMode * Custom layouts are only applicable to recordings with OutputMode
* {@link io.openvidu.java.client.Recording.OutputMode#COMPOSED} (or * {@link io.openvidu.java.client.Recording.OutputMode#COMPOSED} (or
* {@link io.openvidu.java.client.Recording.OutputMode#COMPOSED_QUICK_START}) and * {@link io.openvidu.java.client.Recording.OutputMode#COMPOSED_QUICK_START})
* RecordingLayout {@link io.openvidu.java.client.RecordingLayout#CUSTOM} * and RecordingLayout {@link io.openvidu.java.client.RecordingLayout#CUSTOM}
*/ */
public SessionProperties.Builder defaultCustomLayout(String path) { public SessionProperties.Builder defaultCustomLayout(String path) {
this.defaultCustomLayout = path; this.defaultCustomLayout = path;
@ -138,6 +140,19 @@ public class SessionProperties {
return this; 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:
* 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> Call this method to force the session to be hosted in the
* Media Node with identifier <code>mediaNodeId</code>
*/
public SessionProperties.Builder mediaNode(String mediaNodeId) {
this.mediaNode = mediaNodeId;
return this;
}
} }
protected SessionProperties() { protected SessionProperties() {
@ -147,16 +162,18 @@ public class SessionProperties {
this.defaultRecordingLayout = RecordingLayout.BEST_FIT; this.defaultRecordingLayout = RecordingLayout.BEST_FIT;
this.defaultCustomLayout = ""; this.defaultCustomLayout = "";
this.customSessionId = ""; this.customSessionId = "";
this.mediaNode = "";
} }
private SessionProperties(MediaMode mediaMode, RecordingMode recordingMode, OutputMode outputMode, private SessionProperties(MediaMode mediaMode, RecordingMode recordingMode, OutputMode outputMode,
RecordingLayout layout, String defaultCustomLayout, String customSessionId) { RecordingLayout layout, String defaultCustomLayout, String customSessionId, String mediaNode) {
this.mediaMode = mediaMode; this.mediaMode = mediaMode;
this.recordingMode = recordingMode; this.recordingMode = recordingMode;
this.defaultOutputMode = outputMode; this.defaultOutputMode = outputMode;
this.defaultRecordingLayout = layout; this.defaultRecordingLayout = layout;
this.defaultCustomLayout = defaultCustomLayout; this.defaultCustomLayout = defaultCustomLayout;
this.customSessionId = customSessionId; this.customSessionId = customSessionId;
this.mediaNode = mediaNode;
} }
/** /**
@ -213,8 +230,8 @@ public class SessionProperties {
* with any other value.<br> * with any other value.<br>
* Custom layouts are only applicable to recordings with OutputMode * Custom layouts are only applicable to recordings with OutputMode
* {@link io.openvidu.java.client.Recording.OutputMode#COMPOSED} (or * {@link io.openvidu.java.client.Recording.OutputMode#COMPOSED} (or
* {@link io.openvidu.java.client.Recording.OutputMode#COMPOSED_QUICK_START}) and * {@link io.openvidu.java.client.Recording.OutputMode#COMPOSED_QUICK_START})
* RecordingLayout {@link io.openvidu.java.client.RecordingLayout#CUSTOM} * and RecordingLayout {@link io.openvidu.java.client.RecordingLayout#CUSTOM}
*/ */
public String defaultCustomLayout() { public String defaultCustomLayout() {
return this.defaultCustomLayout; return this.defaultCustomLayout;
@ -231,4 +248,17 @@ public class SessionProperties {
return this.customSessionId; return this.customSessionId;
} }
/**
* <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> The Media Node where to host the session. The default
* option if this property is not defined is the less loaded Media Node at the
* moment the first user joins the session.
*/
public String mediaNode() {
return this.mediaNode;
}
} }

View File

@ -64,4 +64,13 @@ export interface SessionProperties {
* If this parameter is undefined or an empty string, OpenVidu Server will generate a random sessionId for you. * If this parameter is undefined or an empty string, OpenVidu Server will generate a random sessionId for you.
*/ */
customSessionId?: string; customSessionId?: 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>
*
* The Media Node where to host the session. The default option if this property is not defined is the less loaded
* Media Node at the moment the first user joins the session.
*/
mediaNode?: string;
} }