Legarndary Legarndary - 9 months ago 149
Javascript Question

Start html5 video within an owl.carousel

I'm building a males fashion site with a slider that have both images and a video in it. I'm using owl.carousel as a slider. The video is an plane HTML5 video tag.

I'm trying to start the video whith jquery like this:


It works perfectly when the video is outside the slider/carousel, but how do i start it inside?

Codepen link

Answer Source

I just look your codepen. After few tests, I saw two containers with class video-slider with a video tag with the same id "video" inside. (Check with debug console on the render view and the jquery code $(".video-slide").children()).

You can start the videoS with the jquery code $(".video-slide").children().each(function() { this.play(); }); but before you need to find where and why your blocks are duplicated.

I hope it helps