How can I use the "splidejs" slider with the “splide-extension-video” with the following requirements?
- The slider moves automatically after a certain time (works)
- The current visible video always starts from the beginning (does not work). Currently it stops when changing and then resumes at the last position.
The problem is that the preview image appears first before the video. But if the video doesn’t start from the beginning, it doesn’t fit together anymore. You can either deactivate the still image somehow (?) or always play the video from the beginning (?).
const splide = new Splide( '.splide', {
width: '100%',
arrows: false,
type : 'loop',
autoplay: true,
interval: 4000,
perPage : 1,
speed : 2000,
video: {
autoplay: true,
loop : true,
mute : true,
hideControls: true,
disableOverlayUI: true,
playerOptions: { htmlVideo: {} },
}
} );
splide.mount(window.splide.Extensions);
Thanks…
2
Answers
How do you manage to activate autoplay again after manually switching to another slide by pressing the pagination button and after leaving the slider area? Currently autoplay:play event is not further called, the last one is autoplay:pause. I just want it to automatically switch to the next video after the interval time after a manual switch.
Thanks...
Since you are referring to html5 video,
mediaElement.currentTime = 0;
is what you need, probably on the event ofmove
of the slider. Yes, it’s a little crude, but it works.