]> _ Git - cubeextranet.git/commitdiff
wip #5417 @0.25
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 25 Aug 2022 10:25:18 +0000 (10:25 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 25 Aug 2022 10:25:18 +0000 (10:25 +0000)
inc/ws/Util/html5/master/class.ws.html5.links.php

index b18924d3b77564374401c17abec2cec458c6346e..3c0e63898d5de9303387a1af06865ca29d4a03f4 100644 (file)
@@ -835,7 +835,16 @@ class wsHTML5Link
 
     public function getConfigHTML($d, $html)
     {
+
+        $c = file_get_contents($this->wdir . $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);