It plays after the list has played through and it goes back to the first video, but I'm going to need it to play on page load as well.
This is the HTML:
Expand|Select|Wrap|Line Numbers
- <section class="col1">
- <div><video width="1280px" height="720px" autoplay class="video" src="video/video1.mp4" type="video/mp4">Your browser does not support video</video></div>
- <div><video width="1280px" height="720px" autoplay class="video" src="video/video2.mp4" type="video/mp4">Your browser does not support video</video></div>
- <div><video width="1280px" height="720px" autoplay class="video" src="video/video3.mp4" type="video/mp4">Your browser does not support video</video></div>
- <div><video width="1280px" height="720px" autoplay class="video" src="video/video4.mp4" type="video/mp4">Your browser does not support video</video></div>
- <div><video width="1280px" height="720px" autoplay class="video" src="video/video5.mp4" type="video/mp4">Your browser does not support video</video></div>
- <div><video width="1280px" height="720px" autoplay class="video" src="video/video6.mp4" type="video/mp4">Your browser does not support video</video></div>
- </section>
Expand|Select|Wrap|Line Numbers
- $(document).ready(function(){
- $('.col1').slick({
- autoplay: true,
- autoplaySpeed: 7000,
- fade: true,
- pauseOnHover: false,
- });
- });
- $('.col1').on('afterChange', function(event, slick, currentSlide)
- {
- var vid = $(slick.$slides[currentSlide]).find('video');
- if (vid.length > 0)
- {
- $('.col1').slick('slickPlay');
- $(vid).get(0).play();
- }
- });
- $('video').on('ended',function()
- {
- console.log('Video Complete')
- $('.col1').slick('slickPlay');
- });