From fc8746baf7b4e2ff74921a51fe3019c3badc3a3e Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Fri, 25 Aug 2017 17:27:46 +0000 Subject: [PATCH] Notes about video size calculations for #1585. --- inc/ws/Util/html5/html5video/class.ws.html5.links.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inc/ws/Util/html5/html5video/class.ws.html5.links.php b/inc/ws/Util/html5/html5video/class.ws.html5.links.php index b4a31233f..88d000e48 100644 --- a/inc/ws/Util/html5/html5video/class.ws.html5.links.php +++ b/inc/ws/Util/html5/html5video/class.ws.html5.links.php @@ -527,6 +527,10 @@ class videoLink extends wsHTML5Link { $w = round($this->width * $this->getCssScale()); $h = round($this->height * $this->getCssScale()); + // Note: width and height for the video is normally measured from the + // preview frame for local files or set to 1280 x 720 for web videos. + // The $w and $h variables here seem to be null generally... + return $this->makeVideoTag($this, $w, $h, $this->compiler); } @@ -561,8 +565,9 @@ class videoLink extends wsHTML5Link { if (!is_null($w) && !is_null($h)) { $attr['width'] = $w; $attr['height'] = $h; - } else if (!is_null($compiler)) { + } else if (!is_null($compiler)) { + // Get video dimensions from thumbnail if possible (locally uploaded files) $path = WS_BOOKS . '/working/' . $compiler->book_id . '/' . $basename . '.jpg'; $dim = getimagesize($path); $attr['width'] = $dim[0]; -- 2.39.5