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'];
+ if (Files::isNotEmpty($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());
+ $r = ['type' => 'html', 'html' => $html, 'inject' => array(), 'injectcss' => array(), 'injectjs' => array()];
- return array_merge($res, $r);
+ return array_merge($res, $r);
+ }
+ return [];
}
public function getConfigOAM($d)
$props = array('default-width' => 'width', 'default-height' => 'height', 'html-page' => 'html');
-
$res = array('type' => 'oam', 'inject' => array(), 'injectcss' => array(), 'injectjs' => array(), 'content' => trim($c->content), 'name' => $c->_name, 'assets' => array());
foreach ($c->properties->property as $p) {
if (isset($props[$p->_name])) {