From 217a1b2f38dfab6f54255fc19ea33866e2e78ab5 Mon Sep 17 00:00:00 2001 From: NiclasNorin <103985736+NiclasNorin@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:19:48 +0200 Subject: [PATCH] Feat: iframe video poster (#344) --- source/php/Component/Iframe/Iframe.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/php/Component/Iframe/Iframe.php b/source/php/Component/Iframe/Iframe.php index ecdb1bd4..0b921c2b 100644 --- a/source/php/Component/Iframe/Iframe.php +++ b/source/php/Component/Iframe/Iframe.php @@ -31,15 +31,21 @@ public function init() } if (isset($src)) { - $this->data['attributeList']['src'] = $this->buildEmbedUrl($src); + $url = $this->buildEmbedUrl($src); + $this->data['attributeList']['src'] = $url; + + if (empty($poster)) { + $this->data['poster'] = apply_filters('ComponentLibrary/Iframe/Poster', $url); + } } if (isset($labels)) { $this->data['labels'] = json_encode($labels); } - if($poster) { + if(!empty($poster)) { $this->data['attributeList']['poster'] = $poster; + $this->data['poster'] = $poster; } $this->data['attributeList']['title'] = $title;