Slick Slider - Video Play slide activo

PHOTO EMBED

Sat Oct 10 2020 02:55:49 GMT+0000 (Coordinated Universal Time)

Saved by @rstringa #video #slider #slick

// On slide change, pause all videos
$('#main-slider').on('beforeChange', function(event, slick, currentSlide, nextSlide){
  $('video').each(function() {
    $(this).get(0).pause();
  });
});

// On slide chnage, play a video inside the current slide
$('#main-slider').on('afterChange', function(event, slick, currentSlide, nextSlide){
  if( $('.project-slide.slick-current').find('video').length !== 0) {
    $("#main-slider .slick-current video")[0].play();
  }
});
content_copyCOPY

https://stackoverflow.com/questions/29901228/add-autoplay-for-video-in-slick-carousel