From 597d219b607a734bc51645d2bc814dcf90aad5f2 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 25 Aug 2022 12:25:36 +0200 Subject: [PATCH] wait #5417 @0:05 --- src/Links/Link.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Links/Link.php b/src/Links/Link.php index d5a5f99..a88da5a 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -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, '
')) { + 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); -- 2.39.5