openvidu-server: Adapt config.getOpenViduRecordingPath to have different recording paths in Media nodes for OpenVidu PRO/ENTERPRISE

pull/750/head
cruizba 2022-10-07 13:46:39 +02:00
parent b489485c42
commit 56b22841ac
4 changed files with 9 additions and 8 deletions

View File

@ -293,8 +293,8 @@ public class OpenviduConfig {
return this.openviduRecordingPath;
}
public String getOpenViduRemoteRecordingPath() {
return getOpenViduRecordingPath();
public String getOpenViduRecordingPath(String key) {
return this.openviduRecordingPath;
}
public boolean getOpenViduRecordingPublicAccess() {

View File

@ -224,7 +224,7 @@ public class ComposedQuickStartRecordingService extends ComposedRecordingService
Volume volume1 = new Volume("/recordings");
List<Volume> volumes = new ArrayList<>();
volumes.add(volume1);
Bind bind1 = new Bind(openviduConfig.getOpenViduRecordingPath(), volume1);
Bind bind1 = new Bind(openviduConfig.getOpenViduRecordingPath(properties.mediaNode()), volume1);
List<Bind> binds = new ArrayList<>();
binds.add(bind1);
containerId = dockerManager.runContainer(properties.mediaNode(), container, containerName, null, volumes,
@ -245,7 +245,7 @@ public class ComposedQuickStartRecordingService extends ComposedRecordingService
private void waitForComposedQuickStartFiles(Recording recording) throws Exception {
final int SECONDS_MAX_WAIT = fileManager.maxSecondsWaitForFile();
final String PATH = this.openviduConfig.getOpenViduRecordingPath() + recording.getId() + "/";
final String PATH = this.openviduConfig.getOpenViduRecordingPath(recording.getRecordingProperties().mediaNode()) + recording.getId() + "/";
// Waiting for the files generated at the end of the stopping process: the
// ffprobe info and the thumbnail

View File

@ -169,7 +169,7 @@ public class ComposedRecordingService extends RecordingService {
Volume volume1 = new Volume("/recordings");
List<Volume> volumes = new ArrayList<>();
volumes.add(volume1);
Bind bind1 = new Bind(openviduConfig.getOpenViduRecordingPath(), volume1);
Bind bind1 = new Bind(openviduConfig.getOpenViduRecordingPath(properties.mediaNode()), volume1);
List<Bind> binds = new ArrayList<>();
binds.add(bind1);
containerId = dockerManager.runContainer(properties.mediaNode(), container, containerName, null, volumes,
@ -205,7 +205,7 @@ public class ComposedRecordingService extends RecordingService {
recording.getSessionId());
CompositeWrapper compositeWrapper = new CompositeWrapper((KurentoSession) session,
"file://" + this.openviduConfig.getOpenViduRecordingPath() + recording.getId() + "/" + properties.name()
"file://" + this.openviduConfig.getOpenViduRecordingPath(properties.mediaNode()) + recording.getId() + "/" + properties.name()
+ ".webm");
this.composites.put(session.getSessionId(), compositeWrapper);
@ -431,7 +431,7 @@ public class ComposedRecordingService extends RecordingService {
}
protected void waitForVideoFileNotEmpty(Recording recording) throws Exception {
final String VIDEO_FILE = this.openviduConfig.getOpenViduRecordingPath() + recording.getId() + "/"
final String VIDEO_FILE = this.openviduConfig.getOpenViduRecordingPath(recording.getRecordingProperties().mediaNode()) + recording.getId() + "/"
+ recording.getName() + RecordingService.COMPOSED_RECORDING_EXTENSION;
this.fileManager.waitForFileToExistAndNotEmpty(recording.getRecordingProperties().mediaNode(), VIDEO_FILE);
log.info("File {} exists and is not empty", VIDEO_FILE);

View File

@ -249,9 +249,10 @@ public class SingleStreamRecordingService extends RecordingService {
KurentoParticipant kurentoParticipant = (KurentoParticipant) participant;
MediaPipeline pipeline = kurentoParticipant.getPublisher().getPipeline();
String kmsUri = kurentoParticipant.getSession().getKms().getUri();
RecorderEndpoint recorder = new RecorderEndpoint.Builder(pipeline,
"file://" + openviduConfig.getOpenViduRemoteRecordingPath() + recordingId + "/" + fileName
"file://" + openviduConfig.getOpenViduRecordingPath(kmsUri) + recordingId + "/" + fileName
+ fileExtension).withMediaProfile(profile).build();
recorder.addRecordingListener(new EventListener<RecordingEvent>() {