Skip to content

Commit

Permalink
Session recording async start when RecordinMode.ALWAYS
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloFuente committed Apr 18, 2018
1 parent fa76fab commit 870600d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 870600d

Please sign in to comment.