I’m new to Webflow and am about to embark on my first build. The design is squared away, but I have a question about custom videos loading on the homepage and how to go about it.
Is it possible to have, say, 3 versions of a video that are selected randomly each time the homepage loads? We’re planning on showcasing different animated versions of our logo as the homepage key art, and would love to have a different version play on each new load…
I’ve been looking at doing the same thing - so thanks for the code.
Just a question on how to implement this - where would the JS go? - do you have a webflow example? - or could you do one?
The javascript would go into your page settings. Scroll to the bottom of the page settings, and insert the code into the Before </ body> tag.
Make sure to change the “.vid” in the javascript to match the class you’ve already set. So if you’ve named your video element “video”, “video-player”, etc., then change the javascript from “.vid” to “.video”, “.video-player”, or whatever you’ve named it. Look at example below.