From 8b407e3df3abd6dd7e8f2846777c7e07352be8c5 Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Tue, 2 Jun 2020 17:49:35 -0500 Subject: [PATCH] Changed video html element to use the image objects height and width, if available --- ext/handle_video/theme.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/handle_video/theme.php b/ext/handle_video/theme.php index f0e7b71e..5f6dbbcd 100644 --- a/ext/handle_video/theme.php +++ b/ext/handle_video/theme.php @@ -16,6 +16,15 @@ class VideoFileHandlerTheme extends Themelet $loop = $config->get_bool("video_playback_loop"); $player = make_link('vendor/bower-asset/mediaelement/build/flashmediaelement.swf'); + $width="auto"; + if ($image->width>1) { + $width = $image->width."px"; + } + $height="auto"; + if ($image->height>1) { + $height = $image->height."px"; + } + $html = "Video not playing? Click here to download the file.
"; //Browser media format support: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats @@ -53,7 +62,7 @@ class VideoFileHandlerTheme extends Themelet $html .= "