openvidu-server: by default append /inspector to recording composed url

pull/447/head
pabloFuente 2020-04-18 15:27:03 +02:00
parent 52219c8d54
commit 9dbce15758
3 changed files with 15 additions and 9 deletions

View File

@ -352,6 +352,10 @@ public class OpenviduConfig {
return !"/opt/openvidu/custom-layout".equals(path); return !"/opt/openvidu/custom-layout".equals(path);
} }
public String getOpenViduRecordingDefaultLayoutsPath() {
return "dashboard";
}
// Properties management methods // Properties management methods
public OpenviduConfig deriveWithAdditionalPropertiesSource(Map<String, ?> propertiesSource) { public OpenviduConfig deriveWithAdditionalPropertiesSource(Map<String, ?> propertiesSource) {

View File

@ -45,7 +45,6 @@ import io.openvidu.client.OpenViduException;
import io.openvidu.client.OpenViduException.Code; import io.openvidu.client.OpenViduException.Code;
import io.openvidu.java.client.RecordingLayout; import io.openvidu.java.client.RecordingLayout;
import io.openvidu.java.client.RecordingProperties; import io.openvidu.java.client.RecordingProperties;
import io.openvidu.server.OpenViduServer;
import io.openvidu.server.cdr.CallDetailRecord; import io.openvidu.server.cdr.CallDetailRecord;
import io.openvidu.server.config.OpenviduConfig; import io.openvidu.server.config.OpenviduConfig;
import io.openvidu.server.core.EndReason; import io.openvidu.server.core.EndReason;
@ -506,15 +505,15 @@ public class ComposedRecordingService extends RecordingService {
} }
} }
boolean recordingUrlDefined = openviduConfig.getOpenViduRecordingComposedUrl() != null boolean recordingComposedUrlDefined = openviduConfig.getOpenViduRecordingComposedUrl() != null
&& !openviduConfig.getOpenViduRecordingComposedUrl().isEmpty(); && !openviduConfig.getOpenViduRecordingComposedUrl().isEmpty();
String recordingUrl = recordingUrlDefined ? openviduConfig.getOpenViduRecordingComposedUrl() String recordingUrl = recordingComposedUrlDefined ? openviduConfig.getOpenViduRecordingComposedUrl()
: OpenViduServer.wsUrl; : openviduConfig.getFinalUrl();
recordingUrl = recordingUrl.replaceFirst("wss://", "").replaceFirst("https://", ""); recordingUrl = recordingUrl.replaceFirst("https://", "");
boolean startsWithHttp = recordingUrl.startsWith("http://") || recordingUrl.startsWith("ws://"); boolean startsWithHttp = recordingUrl.startsWith("http://");
if (startsWithHttp) { if (startsWithHttp) {
recordingUrl = recordingUrl.replaceFirst("http://", "").replaceFirst("ws://", ""); recordingUrl = recordingUrl.replaceFirst("http://", "");
} }
if (recordingUrl.endsWith("/")) { if (recordingUrl.endsWith("/")) {
@ -539,8 +538,11 @@ public class ComposedRecordingService extends RecordingService {
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
log.error(e.getMessage()); log.error(e.getMessage());
} }
String defaultPathForDefaultLayout = recordingComposedUrlDefined ? ""
: ("/" + openviduConfig.getOpenViduRecordingDefaultLayoutsPath());
finalUrl = (startsWithHttp ? "http" : "https") + "://OPENVIDUAPP:" + secret + "@" + recordingUrl finalUrl = (startsWithHttp ? "http" : "https") + "://OPENVIDUAPP:" + secret + "@" + recordingUrl
+ "/#/layout-" + layout + "/" + recording.getSessionId() + "/" + secret + "/" + port + "/" + !recording.hasAudio(); + defaultPathForDefaultLayout + "/#/layout-" + layout + "/" + recording.getSessionId() + "/"
+ secret + "/" + port + "/" + !recording.hasAudio();
} }
return finalUrl; return finalUrl;

View File

@ -59,7 +59,7 @@ node('container') {
sh 'cd openvidu/openvidu-server && mvn --batch-mode -Dtest=io.openvidu.server.test.integration.*Test test' sh 'cd openvidu/openvidu-server && mvn --batch-mode -Dtest=io.openvidu.server.test.integration.*Test test'
} }
stage('OpenVidu Server build') { stage('OpenVidu Server build') {
sh 'cd openvidu/openvidu-server/src/dashboard && npm install --unsafe-perm && npm link openvidu-browser && export NG_CLI_ANALYTICS=ci && ./node_modules/@angular/cli/bin/ng build --prod --output-path ../main/resources/static' sh 'cd openvidu/openvidu-server/src/dashboard && npm install --unsafe-perm && npm link openvidu-browser && export NG_CLI_ANALYTICS=ci && npm run build-prod'
sh 'cd openvidu/openvidu-server && mvn --batch-mode clean compile package' sh 'cd openvidu/openvidu-server && mvn --batch-mode clean compile package'
} }
stage ('Environment Launch') { stage ('Environment Launch') {