From 870600dc6a5aa88ced41dae9e7c8a0fae3434862 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Wed, 18 Apr 2018 15:23:55 +0200 Subject: [PATCH] Session recording async start when RecordinMode.ALWAYS --- .../main/java/io/openvidu/server/core/SessionManager.java | 5 ++--- .../openvidu/server/kurento/core/KurentoSessionManager.java | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openvidu-server/src/main/java/io/openvidu/server/core/SessionManager.java b/openvidu-server/src/main/java/io/openvidu/server/core/SessionManager.java index 03d3068926..685c0d34cf 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/core/SessionManager.java +++ b/openvidu-server/src/main/java/io/openvidu/server/core/SessionManager.java @@ -268,9 +268,8 @@ public Participant newParticipant(String sessionId, String participantPrivatetId public Participant newRecorderParticipant(String sessionId, String participantPrivatetId, Token token, String clientMetadata) { if (this.sessionidParticipantpublicidParticipant.get(sessionId) != null) { - String participantPublicId = ProtocolElements.RECORDER_PARTICIPANT_PUBLICID; - Participant p = new Participant(participantPrivatetId, participantPublicId, token, clientMetadata); - this.sessionidParticipantpublicidParticipant.get(sessionId).put(participantPublicId, p); + Participant p = new Participant(participantPrivatetId, ProtocolElements.RECORDER_PARTICIPANT_PUBLICID, token, clientMetadata); + this.sessionidParticipantpublicidParticipant.get(sessionId).put(ProtocolElements.RECORDER_PARTICIPANT_PUBLICID, p); return p; } else { throw new OpenViduException(Code.ROOM_NOT_FOUND_ERROR_CODE, sessionId); diff --git a/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java b/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java index 483df48a52..493555fd15 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java +++ b/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java @@ -233,7 +233,10 @@ public void publishVideo(Participant participant, MediaOptions mediaOptions, Int && RecordingMode.ALWAYS.equals(session.getSessionProperties().recordingMode()) && !recordingService.sessionIsBeingRecorded(session.getSessionId()) && session.getActivePublishers() == 0) { - recordingService.startRecording(session, null); + // Insecure session recording + new Thread(() -> { + recordingService.startRecording(session, null); + }).start(); } session.newPublisher(participant);