From 67696d08daa4d3c61fb278af117fb78d21ae5e3f Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 7 Mar 2024 14:22:40 +0000 Subject: [PATCH] Set default value for max video height --- src/Model/Item.php | 2 +- static/defaults.config.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index b5e31f0fba..9ef59c73d0 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -3644,7 +3644,7 @@ class Item if ($PostMedia->mimetype->type == 'video') { if (($PostMedia->height ?? 0) > ($PostMedia->width ?? 0)) { - $height = min(DI::config()->get('system', 'max_video_height'), $PostMedia->height); + $height = min(DI::config()->get('system', 'max_video_height') ?: '100%', $PostMedia->height); $width = 'auto'; } else { $height = 'auto'; diff --git a/static/defaults.config.php b/static/defaults.config.php index 8a13c61a39..7c17dce227 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -407,6 +407,10 @@ return [ // Maximum recursion depth when fetching posts until the job is delegated to a worker task or finished. 'max_recursion_depth' => 50, + // max_video_height (Integer) + // Maximum height of videos in portrait mode. + 'max_video_height' => 640, + // memcache_host (String) // Host name of the memcache daemon. 'memcache_host' => '127.0.0.1',