]> _ Git - cubeextranet.git/commitdiff
Notes about video size calculations for #1585.
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 25 Aug 2017 17:27:46 +0000 (17:27 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 25 Aug 2017 17:27:46 +0000 (17:27 +0000)
inc/ws/Util/html5/html5video/class.ws.html5.links.php

index b4a31233f6230fab71728d3bbfc3f365693390f5..88d000e4825b1e5383642895506e96f0f8a57baa 100644 (file)
@@ -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];