Search
 
SCRIPT & CODE EXAMPLE
 

HTML

slick slider video play

	<div id="slideBox">
		<!--Sidebar-->
			
		<div id="main-image" class="sliderMain">
			<div><img src="https://placeimg.com/640/480/any"></div>
			<div><img src="https://placeimg.com/640/480/any"></div>
			<div><img src="https://placeimg.com/640/480/any"></div>
			<div><img src="https://placeimg.com/640/480/any"></div>
			<div><img src="https://placeimg.com/640/480/any"></div>
			<div id="slide-video">
				<video width="900px" id="theVideo">
					<source src="https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4" />
				</video>
			</div>
		</div>
			
	</div><!--slideBox-->

<script>
		$(document).ready(function() {
    $('.sliderMain').slick({
        slidesToShow: 1,
        slidesToScroll: 1,
        arrows: false,
        fade: false,
        autoplay: true,
        autoplaySpeed: 3000,
        infinite: false,
    });

    $('.sliderMain').on('afterChange', function(event, slick, currentSlide) 
    {
        var video = $('.sliderMain .slick-active').find('video');
        if ($('.slick-current').find('video').length !== 0) 
        {
            $('.sliderMain').slick('slickPause');
            theVideo.play();
        }
    });
    document.getElementById('theVideo').addEventListener('ended', myHandler, false);
    function myHandler(e) 
  	{
        $('.sliderMain').slick('slickPlay');
    }
});
</script>
Comment

PREVIOUS NEXT
Code Example
Html :: Bootstrap class make your form inputs look nicer 
Html :: google map for html 
Html :: video player html 
Html :: input is a void element tag and must neither have `children` not use `dangerouslySetInnerHTML`. 
Html :: comment a div in html 
Html :: css stick div to bottom of page 
Html :: icon inside input tag 
Html :: html iframe connection refused 
Html :: aria-label 
Html :: html table tag 
Html :: how to put dowloadable resume on website html 
Html :: html unordered list 
Html :: character for degrees 
Html :: bootstrap 5 tab 
Html :: radio checked on start 
Html :: dark blue html code 
Html :: html basic website 
Html :: html css block button 
Html :: what does ul mean html 
Html :: delete code html 
Html :: how to jump line in html 
Html :: iframe render html in angular 
Html :: unordered list html 
Html :: progress-bar-success bootstrap 4 
Html :: etiqueta tachado html 
Html :: onclick on input type checkbox field 
Html :: html2pdf pagebreak option 
Html :: horizontal line html 
Html :: thumbnail html 
Html :: how to create animated text in html 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =