diff --git a/src/main/java/org/olat/modules/video/ui/VideoDisplayController.java b/src/main/java/org/olat/modules/video/ui/VideoDisplayController.java index 8ec49630f97d5248f16c8b2c2d4a2822a4eb72bd..e4102f82d0e90a8d2ab26bea2e0286e3aff40d67 100644 --- a/src/main/java/org/olat/modules/video/ui/VideoDisplayController.java +++ b/src/main/java/org/olat/modules/video/ui/VideoDisplayController.java @@ -157,18 +157,12 @@ public class VideoDisplayController extends BasicController { videoMetadata = videoManager.getVideoMetadata(videoEntry.getOlatResource()); VFSLeaf video = videoManager.getMasterVideoFile(videoEntry.getOlatResource()); + if(videoMetadata != null && videoMetadata.getHeight() != 600 && videoMetadata.getWidth() != 800) { + // we exclude 800x600 because it's the default (unkown) size and in this case we let the browser estimate the size + mainVC.contextPut("height", videoMetadata.getHeight()); + mainVC.contextPut("width", videoMetadata.getWidth()); + } if(video != null || (videoMetadata != null && StringHelper.containsNonWhitespace(videoMetadata.getUrl()))) { - if(displayOptions.isAutoWidth()){ - mainVC.contextPut("height", 480); - mainVC.contextPut("width", "100%"); - } else if(videoMetadata != null) { - mainVC.contextPut("height", videoMetadata.getHeight()); - mainVC.contextPut("width", videoMetadata.getWidth()); - } else { - mainVC.contextPut("height", 480); - mainVC.contextPut("width", 640); - } - // Load users preferred version from GUI prefs UserSession usess = ureq.getUserSession(); Preferences guiPrefs = usess.getGuiPreferences(); diff --git a/src/main/java/org/olat/modules/video/ui/_content/video_run.html b/src/main/java/org/olat/modules/video/ui/_content/video_run.html index 8528151d48a547fa2abb866cbb91aab46ea4f39c..79c43779fcf2e7fbfb89d5f65283831bf29c78f8 100644 --- a/src/main/java/org/olat/modules/video/ui/_content/video_run.html +++ b/src/main/java/org/olat/modules/video/ui/_content/video_run.html @@ -38,6 +38,12 @@ stretching: 'responsive', alwaysShowControls: $alwaysShowControls, clickToPlayPause: $clickToPlayPause, + #if($r.isNotEmpty($height)) + videoHeight: $height, + #end + #if($r.isNotEmpty($width)) + videoWidth: $width, + #end hls: { path: '$r.staticLink("movie/mediaelementjs/hls/hls.min.js")', },