# Customizer video tag

**URL:** <https://forum.pinegrow.com/t/customizer-video-tag/5742>\
**Category:** WordPress\
**Created:** [October 6, 2021, 9:33am UTC](https://forum.pinegrow.com/t/customizer-video-tag/5742 "2021-10-06T09:33:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![superfabiuz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/superfabiuz/32/3920_2.png) [@superfabiuz](https://forum.pinegrow.com/u/superfabiuz)\
**Post date:** [October 6, 2021, 9:33am UTC](https://forum.pinegrow.com/t/customizer-video-tag/5742/1 "2021-10-06T09:33:37Z")

</div>

Hello everyone!  
I can’t figure out how to customize the “poster” property and the “src” property of video tag for theme export.

I need to change:  
**poster="assets/images/thumbnail-miami.jpg"**  
and  
**src="[https://www.fasasoft.eu/video/miami-4k.mp4](https://www.fasasoft.eu/video/miami-4k.mp4)"**

```auto
<video controls preload="metadata" poster="assets/images/thumbnail-miami.jpg" controls playsinline controlsList="nodownload">
<source src="https://www.fasasoft.eu/video/miami-4k.mp4" type="video/mp4"
</video>

```

I also read this [post](https://forum.pinegrow.com/t/is-there-a-bug-with-customizer-control/4877) but unfortunately it didn’t help me, maybe I’m doing something wrong.

I tried to use “Add Customizer Control” but with bad results. Can someone help me?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![superfabiuz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/superfabiuz/32/3920_2.png) [@superfabiuz](https://forum.pinegrow.com/u/superfabiuz)\
**Post date:** [October 7, 2021, 11:55am UTC](https://forum.pinegrow.com/t/customizer-video-tag/5742/2 "2021-10-07T11:55:36Z")

</div>

I solved the first part, a custom control for the “src” attribute width the control type “url”

```auto
<video id="hero_video" autoplay loop muted playsinline controlsList="nodownload"
src="https://www.fasasoft.eu/video/miami-4k.mp4" type="video/mp4"
poster="assets/images/1200x560-frame-miami.jpg"></video>

```

 ![Screenshot 2021-10-07 at 13.43.07](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/e/eea0e8c04b1bd3f26d874fe194d7932e2d71dae7.png)

But how can I also resolve the “url” of the “poster” attribute?  
I would like to be able to insert a new “Add Customizer Control” and a new “Theme Mod To Attr” but it is not possible, so I assume that I can only change one attribute. 😩  
Am I doing something wrong?  
This is a problem! Anyone have any idea how to fix this and can help me?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [October 7, 2021, 7:22pm UTC](https://forum.pinegrow.com/t/customizer-video-tag/5742/3 "2021-10-07T19:22:32Z")

</div>

Hi @superfabiuz,  
Sorry for the delay in answering - I had to work it out for myself first! 😁  
So to accomplish this you will need two customizer controls. I’m going off of the original HTML you first posted.  
The first customizer control to change the `source` src is what you have already worked out. So this should be applied to the `source` element.  
The second customizer control should be added to the `video` element. In this case, you add the normal customizer control action. Select a control type of media and a mime type of image.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/d/dea1cb9163d4309c3f6c0eab390384570cae435e.png)

This will return the id of the media which has to be converted to the url.

> NOTE: I used an id of `link_poster_preview`, change this to what you would like both in the control and custom PHP.

To convert the id to a URL and add in to the `video` element we will add a PHP code action block. Within the PHP code action block, replace the “Attribute” with an attribute name of poster. Click on the “Get image url from id” checkbox. Then for the function add:

```auto
get_theme_mod('link_poster_preview')

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/4/4f9335c745739bf72a416dc4c6b3fa2d4aecb06c.png)

Hope this helps,  
Bob

---

<div class="post-metadata">

**Author:** ![superfabiuz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/superfabiuz/32/3920_2.png) [@superfabiuz](https://forum.pinegrow.com/u/superfabiuz)\
**Post date:** [October 8, 2021, 8:28am UTC](https://forum.pinegrow.com/t/customizer-video-tag/5742/4 "2021-10-08T08:28:11Z")

</div>

Thank you very much Bob, you have been very helpful to me.  
Fabio
