Video preload Property

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.

But rather the HTML DOM element, as described here:
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

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

2 Likes

This

oneVideo.elt.preload = 'auto';

and this

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

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

3 Likes

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