Closed alexpeto closed 2 years ago
You have to not use the autoplay function - you can then listen to when your video object has ended and then call .slide on the Swiffy slider:
document.getElementById('myVideo').addEventListener('ended',myHandler,false);
function myHandler(e) {
// What you want to do after the event
swiffyslider.slide(document.getElementById('mySwiffyslider'), next = true);
}
If you want it to autoplay all slides and stay on the video as long as it plays, you need some more script - you need the above for video slides and then combine it with a timer like below for the rest.
setInterval(() => swiffyslider.slide(sliderElement), 2500);
BR Nicolai
thank you. it worked!
Hello! I like this slider. I managed to use it in my project but wanted to automatically play next slide only when video is ended or paused, but I couldn't figure out how to achieve this. I am asking: how can this be done? Thank you!