mirror of https://github.com/OpenVidu/openvidu.git
openvidu-java-client: fix Recording initialization from JSON
parent
1b23996479
commit
6eca1f1e71
|
@ -120,22 +120,7 @@ public class Recording {
|
||||||
}
|
}
|
||||||
this.status = Recording.Status.valueOf(json.get("status").getAsString());
|
this.status = Recording.Status.valueOf(json.get("status").getAsString());
|
||||||
|
|
||||||
boolean hasAudio = json.get("hasAudio").getAsBoolean();
|
this.recordingProperties = RecordingProperties.fromJson(json);
|
||||||
boolean hasVideo = json.get("hasVideo").getAsBoolean();
|
|
||||||
|
|
||||||
OutputMode outputMode = OutputMode.valueOf(json.get("outputMode").getAsString());
|
|
||||||
RecordingProperties.Builder builder = new RecordingProperties.Builder().name(json.get("name").getAsString())
|
|
||||||
.outputMode(outputMode).hasAudio(hasAudio).hasVideo(hasVideo);
|
|
||||||
if ((OutputMode.COMPOSED.equals(outputMode) || OutputMode.COMPOSED_QUICK_START.equals(outputMode))
|
|
||||||
&& hasVideo) {
|
|
||||||
builder.resolution(json.get("resolution").getAsString());
|
|
||||||
builder.recordingLayout(RecordingLayout.valueOf(json.get("recordingLayout").getAsString()));
|
|
||||||
JsonElement customLayout = json.get("customLayout");
|
|
||||||
if (customLayout != null) {
|
|
||||||
builder.customLayout(customLayout.getAsString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.recordingProperties = builder.build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -450,7 +450,11 @@ public class RecordingProperties {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (json.has("mediaNode")) {
|
if (json.has("mediaNode")) {
|
||||||
builder.mediaNode(json.get("mediaNode").getAsString());
|
if (json.get("mediaNode").isJsonObject()) {
|
||||||
|
builder.mediaNode(json.get("mediaNode").getAsJsonObject().get("id").getAsString());
|
||||||
|
} else if (json.get("mediaNode").isJsonPrimitive()) {
|
||||||
|
builder.mediaNode(json.get("mediaNode").getAsString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue