We are using Slick Carousel with video in the slider. There are 3 slides with a different video in each. All the videos are the same size and are all 6 seconds long. The slider is set to change after 6 seconds.
So in theory the videos should start when each slider is displayed. unfortunately this is not the case and over time the videos become progressively out of sync.
The site and videos are both hosted on umbraco cloud.
Does anyone know how to sync these videos so they start to play when the slider is displayed each time.
It might be worth looking at the slick 'beforeChange' event. Here, you have access to the current slide and to the next slide, so you should be able to stop the current video playing, and then start the next video playing.
I think you need to target both the current slide and also the next slide. Looking back on something I did previously, you might be able to apply it to your scenario. In my case, as each slide changed, I was changing the style of the navigation, for example, on one slide the navigation might be black and then on the next slide the navigation colour would change to white, therefore before each change I was removing a class (this is where you would stop the video), and then I would add the new class to the next slide (in your case playing the next video)
$('.sliders').on('beforeChange', function (event, slick, currentSlide, nextSlide) {
var current = $(slick.$slides[currentSlide]);
var currentBranding = current.data('branding');
var next = $(slick.$slides[nextSlide]);
var nextBranding = next.data('branding');
$('.navigation').removeClass(currentBranding);
$('.navigation').addClass(nextBranding);
});
Syncing video with Slick carousel
We are using Slick Carousel with video in the slider. There are 3 slides with a different video in each. All the videos are the same size and are all 6 seconds long. The slider is set to change after 6 seconds.
So in theory the videos should start when each slider is displayed. unfortunately this is not the case and over time the videos become progressively out of sync.
The site and videos are both hosted on umbraco cloud. Does anyone know how to sync these videos so they start to play when the slider is displayed each time.
Hi,
It might be worth looking at the slick 'beforeChange' event. Here, you have access to the current slide and to the next slide, so you should be able to stop the current video playing, and then start the next video playing.
Thanks Stephen I have tried this a couple of ways but neither work for me. Any idea where i am going wrong.
and
Hi,
I think you need to target both the current slide and also the next slide. Looking back on something I did previously, you might be able to apply it to your scenario. In my case, as each slide changed, I was changing the style of the navigation, for example, on one slide the navigation might be black and then on the next slide the navigation colour would change to white, therefore before each change I was removing a class (this is where you would stop the video), and then I would add the new class to the next slide (in your case playing the next video)
Hope this helps in some way.
is working on a reply...