# Preload="auto" on Video Component

**URL:** <https://forum.builder.io/t/preload-auto-on-video-component/3707>\
**Category:** Visual Editor Help\
**Created:** [June 12, 2023, 8:19am UTC](https://forum.builder.io/t/preload-auto-on-video-component/3707 "2023-06-12T08:19:45Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![RonHagafny](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@RonHagafny](https://forum.builder.io/u/RonHagafny)\
**Post date:** [June 12, 2023, 8:19am UTC](https://forum.builder.io/t/preload-auto-on-video-component/3707/1 "2023-06-12T08:19:45Z")

</div>

I would like to add a preload=“auto” attribute to my video component to let the browser know it’s top priority. How would I be able to achieve that using builder?

I tried using HTML Attributes but that one attaches those attributes to the div container, not the video component itself.

Any ideas?

Thanks

---

<div class="post-metadata">

**Author:** ![anon43891756](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@anon43891756](https://forum.builder.io/u/anon43891756)\
**Post date:** [June 12, 2023, 8:52am UTC](https://forum.builder.io/t/preload-auto-on-video-component/3707/2 "2023-06-12T08:52:17Z")

</div>

Hi @RonHagafny,

We hope you’re doing well!

I tried too but it seems using HTML attributes, it adding the property to the parent div instead video element. So to workaround this you can use Custom JS, for example:-

```auto
let videos = document.getElementsByClassName('builder-video');

//Set attribute only to the first video in a page
videos[0].setAttribute("preload", "auto");

//or

//Set attribute to all videos in the page
for(let i=0; i < allVideos.length; i++){
    videos[i].setAttribute("preload", "auto");
}

```

Let us know if you’ve further questions!

---

<div class="post-metadata">

**Author:** ![RonHagafny](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@RonHagafny](https://forum.builder.io/u/RonHagafny)\
**Post date:** [June 12, 2023, 9:14am UTC](https://forum.builder.io/t/preload-auto-on-video-component/3707/3 "2023-06-12T09:14:34Z")

</div>

I have no doubt that’ll work , but if we are waiting for Javascript to work until the attribute is added dynamically, doesn’t that defeat the purpose?

It wouldn’t give me the same performance optimization as i’d get if the HTMl was already statically rendered with the preload=“auto” tag already set

---

<div class="post-metadata">

**Author:** ![anon43891756](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@anon43891756](https://forum.builder.io/u/anon43891756)\
**Post date:** [June 12, 2023, 9:18am UTC](https://forum.builder.io/t/preload-auto-on-video-component/3707/4 "2023-06-12T09:18:23Z")

</div>

@RonHagafny, Indeed- I agree with you. I’ll discuss with our internal team to register this as feedback or if anyone has a better solution over this!

---

<div class="post-metadata">

**Author:** ![RonHagafny](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@RonHagafny](https://forum.builder.io/u/RonHagafny)\
**Post date:** [June 12, 2023, 9:36am UTC](https://forum.builder.io/t/preload-auto-on-video-component/3707/5 "2023-06-12T09:36:50Z")

</div>

Thanks Garima for the quick feedback.  
One of the reasons that I chose Builder was because I eventually want the best experience in building static landing pages. Eventually, if Builder is blocking me from executing what I need (I.E: preload=‘auto’ on videos), than I’d need to revert to building my pages with code and no one wants that.

In my opinion, Adding a new advanced setting for the video component that allows us to choose the wanted preload method should be very valuable (Also, I don’t work at Builder, but tech wise it seems like a very short task to build)

BTW: The same goes for the “lazy” property in your Image component. As far as I know, Builder decides it automatically adds it as lazy, but what if I don’t want it to be?

Same thing, but video is of bigger concern.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![anon43891756](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@anon43891756](https://forum.builder.io/u/anon43891756)\
**Post date:** [June 12, 2023, 9:59am UTC](https://forum.builder.io/t/preload-auto-on-video-component/3707/6 "2023-06-12T09:59:30Z")

</div>

@RonHagafny, encourage you to submit a feature request (to add a toggle for lazy property for the image component too in advance settings same as in the video) here [Builder.io Ideas](https://ideas.builder.io/ideas).

As a workaround, you can open the JSON view of the image and set the lazy value as false if you don’t want it to be:-

 ![image](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/b/bded2ace0b3797559ba54c914888d8a61493b4ae.jpeg)

The space-wise setting of lazy loading can be done from Account Settings\>Advanced settings\>Performance:-

 ![image](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/5/584f08ddb7bcffca8bdb4b1a4fc4e2ac97d9c4e6.png)

---

<div class="post-metadata">

**Author:** ![RonHagafny](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@RonHagafny](https://forum.builder.io/u/RonHagafny)\
**Post date:** [June 19, 2023, 8:28am UTC](https://forum.builder.io/t/preload-auto-on-video-component/3707/7 "2023-06-19T08:28:29Z")

</div>

Hey,

In my website, my has lazy: “false”, and yet it is lazily loaded. It’s obviously above the fold. What’s going on?

---

<div class="post-metadata">

**Author:** ![anon43891756](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@anon43891756](https://forum.builder.io/u/anon43891756)\
**Post date:** [June 20, 2023, 6:48am UTC](https://forum.builder.io/t/preload-auto-on-video-component/3707/8 "2023-06-20T06:48:09Z")

</div>

@RonHagafny, Did you manually set lazy: false from JSON or space-wise setting? Also please share the website link with us so I can investigate.

---

<div class="post-metadata">

**Author:** ![RonHagafny](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@RonHagafny](https://forum.builder.io/u/RonHagafny)\
**Post date:** [June 20, 2023, 8:18am UTC](https://forum.builder.io/t/preload-auto-on-video-component/3707/9 "2023-06-20T08:18:05Z")

</div>

@anon43891756

I manually set lazy:false from JSON. I didn’t touch space-wise setting because it’s set to the recommended settings of only lazy loading images that are not above the fold. Hero image is above the fold

Attached are 2 images. One from builder and one from actual homepage.

 ![Screenshot 2023-06-20 at 11.14.48](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/8/83eba3eee58159082e63432f3e6d85f26befa688.png)  
 ![Screenshot 2023-06-20 at 11.15.49](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/3/39d3d1a22ef43e8b0bedc1908f92d958054d2cdb.png)

Our homepage is [www.easyplant.com](http://www.easyplant.com) (We mainly care for out mobile version but it happens in both Mobile and Desktop)

---

<div class="post-metadata">

**Author:** ![anon43891756](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@anon43891756](https://forum.builder.io/u/anon43891756)\
**Post date:** [June 20, 2023, 8:46am UTC](https://forum.builder.io/t/preload-auto-on-video-component/3707/10 "2023-06-20T08:46:53Z")

</div>

@RonHagafny thank you for further details on this, I’ve tested this on my testing space and it seems bug from our end. I’ll check with the team for a fix and keep you posted!
