# Video preload Property

**URL:** <https://discourse.processing.org/t/video-preload-property/21419>\
**Category:** Beginners\
**Created:** [May 30, 2020, 2:13am UTC](https://discourse.processing.org/t/video-preload-property/21419 "2020-05-30T02:13:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephanschulz](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@stephanschulz](https://discourse.processing.org/u/stephanschulz)\
**Post date:** [May 30, 2020, 2:13am UTC](https://discourse.processing.org/t/video-preload-property/21419/1 "2020-05-30T02:13:47Z")

</div>

Is there a way to force a dynamically loaded video to preload?

I do not want to use the preload() function mentioned in the [reference page](https://p5js.org/reference/#/p5/preload).

But rather the HTML DOM element, as described here:  
[https://www.w3schools.com/jsref/prop\_video\_preload.asp](https://www.w3schools.com/jsref/prop_video_preload.asp)  
`var x = document.getElementById("myVideo").preload;`

I tried `oneVideo.ele.preload = true;`  
but get `Uncaught TypeError: Cannot set property 'preload' of undefined`

Any advice would be great. Thx

---

<div class="post-metadata">

**Author:** ![slow\_izzm](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/slow_izzm/32/5637_2.png) [@slow\_izzm](https://discourse.processing.org/u/slow_izzm)\
**Post date:** [May 30, 2020, 3:08am UTC](https://discourse.processing.org/t/video-preload-property/21419/2 "2020-05-30T03:08:29Z")

</div>

try … `const vid = document.getElementById("myVideo").preload = 'auto';`

---

<div class="post-metadata">

**Author:** ![Sven](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sven/32/8293_2.png) [@Sven](https://discourse.processing.org/u/Sven)\
**Post date:** [May 30, 2020, 10:01am UTC](https://discourse.processing.org/t/video-preload-property/21419/3 "2020-05-30T10:01:58Z")

</div>

This

```javascript
oneVideo.elt.preload = 'auto';

```

and this

```javascript
oneVideo.attribute('preload', 'auto');

```

should work as well. There’s more than one way to skin a cat. 🙂 They are all equal, just a matter of preference.

---

<div class="post-metadata">

**Author:** ![stephanschulz](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@stephanschulz](https://discourse.processing.org/u/stephanschulz)\
**Post date:** [May 30, 2020, 11:32am UTC](https://discourse.processing.org/t/video-preload-property/21419/4 "2020-05-30T11:32:38Z")

</div>

thank you all for these tips.  
I love learning new things every day.  
I am trying to make a video do a palindrome loop and was hoping this would help with strange stutters.  
I will make a new post for this issue.

thx again
