diff --git a/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenVidu.java b/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenVidu.java index e12d868a..de65ec65 100644 --- a/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenVidu.java +++ b/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenVidu.java @@ -75,11 +75,9 @@ public class OpenVidu { protected final static String API_RECORDINGS_STOP = "/stop"; /** - * @param urlOpenViduServer - * Public accessible IP where your instance of OpenVidu Server is up - * an running - * @param secret - * Secret used on OpenVidu Server initialization + * @param urlOpenViduServer Public accessible IP where your instance of OpenVidu + * Server is up an running + * @param secret Secret used on OpenVidu Server initialization */ public OpenVidu(String urlOpenViduServer, String secret) { @@ -136,20 +134,19 @@ public class OpenVidu { /** * Creates an OpenVidu session * - * @param properties - * The specific configuration for this session + * @param properties The specific configuration for this session * * @return The created session * * @throws OpenViduJavaClientException - * @throws OpenViduHttpException - * Value returned from - * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} - * + * @throws OpenViduHttpException Value returned from + * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} + * */ public Session createSession(SessionProperties properties) throws OpenViduJavaClientException, OpenViduHttpException { @@ -161,29 +158,28 @@ public class OpenVidu { /** * Starts the recording of a {@link io.openvidu.java.client.Session} * - * @param sessionId - * The sessionId of the session you want to start recording - * @param properties - * The configuration for this recording + * @param sessionId The sessionId of the session you want to start recording + * @param properties The configuration for this recording * * @return The new created session * * @throws OpenViduJavaClientException - * @throws OpenViduHttpException - * Value returned from - * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} - * + * @throws OpenViduHttpException Value returned from + * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} + * */ @SuppressWarnings("unchecked") public Recording startRecording(String sessionId, RecordingProperties properties) @@ -198,7 +194,7 @@ public class OpenVidu { json.put("hasAudio", properties.hasAudio()); json.put("hasVideo", properties.hasVideo()); - if (Recording.OutputMode.COMPOSED.equals(properties.outputMode())) { + if (Recording.OutputMode.COMPOSED.equals(properties.outputMode()) && properties.hasVideo()) { json.put("resolution", properties.resolution()); json.put("recordingLayout", (properties.recordingLayout() != null) ? properties.recordingLayout().name() : ""); @@ -247,35 +243,35 @@ public class OpenVidu { /** * Starts the recording of a {@link io.openvidu.java.client.Session} * - * @param sessionId - * The sessionId of the session you want to start recording - * @param name - * The name you want to give to the video file. You can access this - * same value in your clients on recording events (recordingStarted, - * recordingStopped). WARNING: this parameter follows an - * overwriting policy. If you name two recordings the same, - * the newest MP4 file will overwrite the oldest one + * @param sessionId The sessionId of the session you want to start recording + * @param name The name you want to give to the video file. You can access + * this same value in your clients on recording events + * (recordingStarted, recordingStopped). WARNING: this + * parameter follows an overwriting policy. If you + * name two recordings the same, the newest MP4 file will + * overwrite the oldest one * * @return The started recording. If this method successfully returns the * Recording object it means that the recording can be stopped with * guarantees * * @throws OpenViduJavaClientException - * @throws OpenViduHttpException - * Value returned from - * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} - * + * @throws OpenViduHttpException Value returned from + * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} + * */ public Recording startRecording(String sessionId, String name) throws OpenViduJavaClientException, OpenViduHttpException { @@ -288,29 +284,29 @@ public class OpenVidu { /** * Starts the recording of a {@link io.openvidu.java.client.Session} * - * @param sessionId - * The sessionId of the session you want to start recording + * @param sessionId The sessionId of the session you want to start recording * * @return The started recording. If this method successfully returns the * Recording object it means that the recording can be stopped with * guarantees * * @throws OpenViduJavaClientException - * @throws OpenViduHttpException - * Value returned from - * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} - * + * @throws OpenViduHttpException Value returned from + * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} + * */ public Recording startRecording(String sessionId) throws OpenViduJavaClientException, OpenViduHttpException { return this.startRecording(sessionId, ""); @@ -319,21 +315,21 @@ public class OpenVidu { /** * Stops the recording of a {@link io.openvidu.java.client.Session} * - * @param recordingId - * The id property of the recording you want to stop + * @param recordingId The id property of the recording you want to stop * * @return The stopped recording * * @throws OpenViduJavaClientException - * @throws OpenViduHttpException - * Value returned from - * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} - * + * @throws OpenViduHttpException Value returned from + * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} + * */ public Recording stopRecording(String recordingId) throws OpenViduJavaClientException, OpenViduHttpException { HttpPost request = new HttpPost( @@ -368,17 +364,15 @@ public class OpenVidu { /** * Gets an existing recording * - * @param recordingId - * The id property of the recording you want to retrieve + * @param recordingId The id property of the recording you want to retrieve * * @throws OpenViduJavaClientException - * @throws OpenViduHttpException - * Value returned from - * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} - * + * @throws OpenViduHttpException Value returned from + * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} + * */ public Recording getRecording(String recordingId) throws OpenViduJavaClientException, OpenViduHttpException { HttpGet request = new HttpGet(OpenVidu.urlOpenViduServer + API_RECORDINGS + "/" + recordingId); @@ -442,19 +436,18 @@ public class OpenVidu { * {@link io.openvidu.java.client.Recording.Status#stopped} or * {@link io.openvidu.java.client.Recording.Status#available} * - * @param recordingId - * The id property of the recording you want to delete + * @param recordingId The id property of the recording you want to delete * * @throws OpenViduJavaClientException - * @throws OpenViduHttpException - * Value returned from - * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} - * + * @throws OpenViduHttpException Value returned from + * {@link io.openvidu.java.client.OpenViduHttpException#getStatus()} + * */ public void deleteRecording(String recordingId) throws OpenViduJavaClientException, OpenViduHttpException { HttpDelete request = new HttpDelete(OpenVidu.urlOpenViduServer + API_RECORDINGS + "/" + recordingId); diff --git a/openvidu-java-client/src/main/java/io/openvidu/java/client/Recording.java b/openvidu-java-client/src/main/java/io/openvidu/java/client/Recording.java index 6f7973b5..feec344c 100644 --- a/openvidu-java-client/src/main/java/io/openvidu/java/client/Recording.java +++ b/openvidu-java-client/src/main/java/io/openvidu/java/client/Recording.java @@ -94,11 +94,13 @@ public class Recording { this.url = (String) json.get("url"); this.status = Recording.Status.valueOf((String) json.get("status")); + boolean hasAudio = (boolean) json.get("hasAudio"); + boolean hasVideo = (boolean) json.get("hasVideo"); + OutputMode outputMode = OutputMode.valueOf((String) json.get("outputMode")); RecordingProperties.Builder builder = new RecordingProperties.Builder().name((String) json.get("name")) - .outputMode(outputMode).hasAudio((boolean) json.get("hasAudio")) - .hasVideo((boolean) json.get("hasVideo")); - if (OutputMode.COMPOSED.equals(outputMode)) { + .outputMode(outputMode).hasAudio(hasAudio).hasVideo(hasVideo); + if (OutputMode.COMPOSED.equals(outputMode) && hasVideo) { builder.resolution((String) json.get("resolution")); builder.recordingLayout(RecordingLayout.valueOf((String) json.get("recordingLayout"))); String customLayout = (String) json.get("customLayout");