mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: ignore empty string on RecordingProperties "mediaNode" param
parent
4891dca38c
commit
635579ad75
|
@ -407,6 +407,9 @@ public class RecordingProperties {
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
public static RecordingProperties fromJson(JsonObject json) {
|
public static RecordingProperties fromJson(JsonObject json) {
|
||||||
|
|
||||||
Boolean hasVideoAux = true;
|
Boolean hasVideoAux = true;
|
||||||
|
@ -450,10 +453,15 @@ public class RecordingProperties {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (json.has("mediaNode")) {
|
if (json.has("mediaNode")) {
|
||||||
|
String mediaNodeId = null;
|
||||||
if (json.get("mediaNode").isJsonObject()) {
|
if (json.get("mediaNode").isJsonObject()) {
|
||||||
builder.mediaNode(json.get("mediaNode").getAsJsonObject().get("id").getAsString());
|
mediaNodeId = json.get("mediaNode").getAsJsonObject().get("id").getAsString();
|
||||||
|
|
||||||
} else if (json.get("mediaNode").isJsonPrimitive()) {
|
} else if (json.get("mediaNode").isJsonPrimitive()) {
|
||||||
builder.mediaNode(json.get("mediaNode").getAsString());
|
mediaNodeId = json.get("mediaNode").getAsString();
|
||||||
|
}
|
||||||
|
if (mediaNodeId != null && !mediaNodeId.isEmpty()) {
|
||||||
|
builder.mediaNode(mediaNodeId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return builder.build();
|
return builder.build();
|
||||||
|
|
|
@ -12,7 +12,7 @@ public final class RecordingUtils {
|
||||||
|
|
||||||
public final static RecordingProperties RECORDING_PROPERTIES_WITH_MEDIA_NODE(Session session) {
|
public final static RecordingProperties RECORDING_PROPERTIES_WITH_MEDIA_NODE(Session session) {
|
||||||
RecordingProperties recordingProperties = session.getSessionProperties().defaultRecordingProperties();
|
RecordingProperties recordingProperties = session.getSessionProperties().defaultRecordingProperties();
|
||||||
if (recordingProperties.mediaNode() == null || recordingProperties.mediaNode().isEmpty()) {
|
if (recordingProperties.mediaNode() == null) {
|
||||||
recordingProperties = new RecordingProperties.Builder(recordingProperties)
|
recordingProperties = new RecordingProperties.Builder(recordingProperties)
|
||||||
.mediaNode(session.getMediaNodeId()).build();
|
.mediaNode(session.getMediaNodeId()).build();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue