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...
Since you are referring to html5 video,
mediaElement.currentTime = 0;is what you need, probably on the event ofmoveof the slider. Yes, it's a little crude, but it works.