mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: recording url fix
parent
c49de8853d
commit
8fd5375608
|
@ -20,7 +20,7 @@ const appRoutes: Routes = [
|
|||
component: LayoutBestFitComponent
|
||||
},
|
||||
{
|
||||
path: 'layout-best-fit/:sessionId/:secret/:onlyVideo/:port',
|
||||
path: 'layout-best-fit/:sessionId/:secret/:port/:onlyVideo',
|
||||
component: LayoutBestFitComponent
|
||||
},
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ const appRoutes: Routes = [
|
|||
component: LayoutVerticalPresentationComponent
|
||||
},
|
||||
{
|
||||
path: 'layout-vertical-presentation/:sessionId/:secret/:onlyVideo/:port',
|
||||
path: 'layout-vertical-presentation/:sessionId/:secret/:port/:onlyVideo',
|
||||
component: LayoutVerticalPresentationComponent
|
||||
},
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ const appRoutes: Routes = [
|
|||
component: LayoutHorizontalPresentationComponent
|
||||
},
|
||||
{
|
||||
path: 'layout-horizontal-presentation/:sessionId/:secret/:onlyVideo/:port',
|
||||
path: 'layout-horizontal-presentation/:sessionId/:secret/:port/:onlyVideo',
|
||||
component: LayoutHorizontalPresentationComponent
|
||||
}
|
||||
];
|
||||
|
|
|
@ -208,7 +208,6 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
|||
try {
|
||||
String containerIp = getContainerIp();
|
||||
OpenViduServer.wsUrl = "wss://" + containerIp + ":" + openviduConf.getServerPort();
|
||||
openviduConf.setFinalUrl("https://" + containerIp + ":" + openviduConf.getServerPort());
|
||||
} catch (Exception e) {
|
||||
log.error("Docker container IP was configured, but there was an error obtaining IP: "
|
||||
+ e.getClass().getName() + " " + e.getMessage());
|
||||
|
@ -235,8 +234,6 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
|||
OpenViduServer.wsUrl = publicUrl.replace("http://", "wss://");
|
||||
}
|
||||
|
||||
openviduConf.setFinalUrl(url.toString());
|
||||
|
||||
if (!OpenViduServer.wsUrl.startsWith("wss://")) {
|
||||
OpenViduServer.wsUrl = "wss://" + OpenViduServer.wsUrl;
|
||||
}
|
||||
|
@ -245,7 +242,6 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
|||
if (OpenViduServer.wsUrl == null) {
|
||||
type = "local";
|
||||
OpenViduServer.wsUrl = "wss://localhost:" + openviduConf.getServerPort();
|
||||
openviduConf.setFinalUrl("https://localhost:" + openviduConf.getServerPort());
|
||||
}
|
||||
|
||||
if (OpenViduServer.wsUrl.endsWith("/")) {
|
||||
|
@ -273,6 +269,8 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
|||
}
|
||||
}
|
||||
|
||||
String finalUrl = OpenViduServer.wsUrl.replaceFirst("wss://", "https://").replaceFirst("ws://", "http://");
|
||||
openviduConf.setFinalUrl(finalUrl);
|
||||
httpUrl = openviduConf.getFinalUrl();
|
||||
log.info("OpenVidu Server using " + type + " URL: [" + OpenViduServer.wsUrl + "]");
|
||||
}
|
||||
|
|
|
@ -446,15 +446,15 @@ public class ComposedRecordingService extends RecordingService {
|
|||
+ "/layouts/custom" + layout + "?sessionId=" + shortSessionId + "&secret=" + secret;
|
||||
} else {
|
||||
layout = recording.getRecordingLayout().name().toLowerCase().replaceAll("_", "-");
|
||||
Integer port = null;
|
||||
int port = startsWithHttp ? 80 : 443;
|
||||
try {
|
||||
port = new URL(openviduConfig.getOpenViduPublicUrl()).getPort();
|
||||
port = new URL(openviduConfig.getFinalUrl()).getPort();
|
||||
} catch (MalformedURLException e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
finalUrl = (startsWithHttp ? "http" : "https") + "://OPENVIDUAPP:" + secret + "@" + recordingUrl
|
||||
+ "/#/layout-" + layout + "/" + shortSessionId + "/" + secret + "/" + !recording.hasAudio()
|
||||
+ ((port != null) ? ("/" + port) : "");
|
||||
+ "/#/layout-" + layout + "/" + shortSessionId + "/" + secret + "/" + port + "/"
|
||||
+ !recording.hasAudio();
|
||||
}
|
||||
|
||||
return finalUrl;
|
||||
|
|
Loading…
Reference in New Issue