]> _ Git - fluidbook_tools.git/commitdiff
wait #5417 @0:05
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 25 Aug 2022 10:25:36 +0000 (12:25 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 25 Aug 2022 10:25:36 +0000 (12:25 +0200)
src/Links/Link.php

index d5a5f99a40d39435b28e0e3ed309d9a0b1499e11..a88da5acd50bdd44c3e177138b4919d91cf54be4 100644 (file)
@@ -622,7 +622,15 @@ class Link
 
     public function getConfigHTML($d, $html)
     {
+        $c = file_get_contents($this->compiler->working_path($html));
         $res = array('width' => $this->video_width, 'height' => $this->video_height);
+        if (stristr($c, '<div id="lottie"></div>')) {
+            if (preg_match('/var animationData = (\{.*\})/', $c, $m)) {
+                $ad = json_decode(trim($m[1]), true);
+                $res['width'] = $ad['w'];
+                $res['height'] = $ad['h'];
+            }
+        }
         $r = array('type' => 'html', 'html' => $html, 'inject' => array(), 'injectcss' => array(), 'injectjs' => array());
 
         return array_merge($res, $r);