Skip to content
Snippets Groups Projects
Commit e63342f3 authored by Florian Gnägi's avatar Florian Gnägi
Browse files

OO-4380 check video format instead of parsing host

parent 7f7b2a3d
No related branches found
No related tags found
No related merge requests found
...@@ -351,11 +351,10 @@ public class VideoDisplayController extends BasicController { ...@@ -351,11 +351,10 @@ public class VideoDisplayController extends BasicController {
private void loadVideo(UserRequest ureq, String url, VideoFormat format) { private void loadVideo(UserRequest ureq, String url, VideoFormat format) {
mainVC.contextPut("externalUrlOriginal", url); mainVC.contextPut("externalUrlOriginal", url);
URIBuilder uriBuilder; if (VideoFormat.vimeo.equals(format)) {
try { URIBuilder uriBuilder;
uriBuilder = new URIBuilder(url); try {
// Check if this is a vimeo video uriBuilder = new URIBuilder(url);
if (uriBuilder.getHost().indexOf("vimeo") != -1) {
// Vimeo allows removing the controls when using the payed service. It ignores the parameter // Vimeo allows removing the controls when using the payed service. It ignores the parameter
// for the free service, so it is save to use it. We use the URIBuilder method in case the // for the free service, so it is save to use it. We use the URIBuilder method in case the
// user already added that parameter or if he uses some other parameters // user already added that parameter or if he uses some other parameters
...@@ -367,9 +366,9 @@ public class VideoDisplayController extends BasicController { ...@@ -367,9 +366,9 @@ public class VideoDisplayController extends BasicController {
uriBuilder.setPath(uriBuilder.getPathSegments().get(0)); uriBuilder.setPath(uriBuilder.getPathSegments().get(0));
} }
url = uriBuilder.build().toString(); url = uriBuilder.build().toString();
} } catch (URISyntaxException e) {
} catch (URISyntaxException e) { logWarn("Error while parsing URL from external video source URL::" + url, e);
logWarn("Error while parsing URL from external video source URL::" + url, e); }
} }
mainVC.contextPut("externalUrl", url); mainVC.contextPut("externalUrl", url);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment