]> _ Git - cubeextranet.git/commitdiff
wip #3399 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 7 Feb 2020 14:03:55 +0000 (14:03 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 7 Feb 2020 14:03:55 +0000 (14:03 +0000)
inc/ws/Util/html5/master/class.ws.html5.links.php

index 53471c5462f4d84ec34b9e40442a6f5d58511c99..9cd8f67824e8fccd304b1590b6ce2fa9aab476ea 100644 (file)
@@ -866,13 +866,16 @@ class videoLink extends wsHTML5Link
         if (!is_null($w) && !is_null($h)) {
             $attr['width'] = $w;
             $attr['height'] = $h;
-
         } 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];
-            $attr['height'] = $dim[1];
+//            $path = WS_BOOKS . '/working/' . $compiler->book_id . '/' . $basename . '.jpg';
+//            $dim = getimagesize($path);
+//            $attr['width'] = $dim[0];
+//            $attr['height'] = $dim[1];
+            $path = WS_BOOKS . '/working/' . $compiler->book_id . '/' . $file;
+            $e = explode(',', `ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 $path`);
+            $attr['width'] = $e[0];
+            $attr['height'] = $e[1];
         }
 
         return $attr;