In this tutorial, I will show you how to create a design where we have multiple videos in a section that will play one after the other.
We are using the Elementor video element for this, along with self hosted videos.
This won't work with YouTube videos or Vimeos. Technically it could work, but it would be so complicated, and the performance not good, that it's not worth it.
So this design is for self hosted videos only, and keep in mind self hosted does not necessarily mean on your own server. Learn how to self host videos with BunnyCDN.
Here is the demo:
Features:
- Polyvalent: You can have 2, 3 or 4 videos (or more!) and it will loop through them automatically.
- Responsive: This works well on mobile too, although there you will run in the normal limitations of videos autoplaying on mobile (essentially it won't work if the device is in power saving mode).
- Accessible: Play/pause toggle button to stop the animation
The way the video playback works is that the active video plays out completely, then when it ends, we proceed to the following video. When there is no more videos, we loop back to the first one.
Credits for the design idea to this website.
Let's get started!
First, let's prepare your video files carefully
This is a premium tutorial. Purchase access to unlock the full tutorial.
6 Responses
Hello Maxim, I have 4 videos, but I'm experiencing issues with the thumbnails changing. You can see it here:
https://sandru.bozhstudio.com/
You can view the issue here
https://sandru.bozhstudio.com/home-duplicate/
Greetings Renz!
Sorry I don't really see the issue. The videos stop at their end frame, and stay there until they play again...
How would you prefer it to work here?
Cheers!
Hi Maxime,
The issue is that the thumbnail of the second video gets replaced with the third video after it plays, and so on. I recorded the issue in the video below.
https://www.dropbox.com/scl/fi/qx64fkw211hk0b7zjrbyn/Screen-Recording-2024-10-15-at-9.28.30-AM.mov?rlkey=021bf0n9oylwqwijy6tqny9k7&dl=0
Greetings Renz,
This is just how your videos are edited... what we see is the end frame, not the first frame of the upcoming video (there is no code at all to do that)
Open your videos in a video player or editor and you will see.
Cheers!
Oh, I didn't notice that. Thank you so much, Maxime, for taking the time to look into the issue.
Cheers!