473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Slick Slider Video

97 64KB
I'm using Ken Wheeler's Slick Slider with some videos but for some reason the first video in the cue doesn't play.

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
  1. <section class="col1">
  2.     <div><video width="1280px" height="720px" autoplay class="video" src="video/video1.mp4" type="video/mp4">Your browser does not support video</video></div>
  3.     <div><video width="1280px" height="720px" autoplay class="video" src="video/video2.mp4" type="video/mp4">Your browser does not support video</video></div>
  4.     <div><video width="1280px" height="720px" autoplay class="video" src="video/video3.mp4" type="video/mp4">Your browser does not support video</video></div>
  5.     <div><video width="1280px" height="720px" autoplay class="video" src="video/video4.mp4" type="video/mp4">Your browser does not support video</video></div>
  6.     <div><video width="1280px" height="720px" autoplay class="video" src="video/video5.mp4" type="video/mp4">Your browser does not support video</video></div>
  7.     <div><video width="1280px" height="720px" autoplay class="video" src="video/video6.mp4" type="video/mp4">Your browser does not support video</video></div>
  8. </section>
  9.  
This is the JS:

Expand|Select|Wrap|Line Numbers
  1. $(document).ready(function(){
  2.     $('.col1').slick({
  3.     autoplay: true,
  4.     autoplaySpeed: 7000,
  5.     fade: true,
  6.     pauseOnHover: false,
  7.   });
  8. });
  9.  
  10.  
  11.  
  12.  
  13. $('.col1').on('afterChange', function(event, slick, currentSlide)
  14. {
  15.     var vid = $(slick.$slides[currentSlide]).find('video');
  16.     if (vid.length > 0)
  17.     {
  18.         $('.col1').slick('slickPlay');
  19.     $(vid).get(0).play();
  20.     }
  21. });
  22.  
  23. $('video').on('ended',function()
  24. {            
  25.     console.log('Video Complete')
  26.     $('.col1').slick('slickPlay');
  27. });
  28.  
Sep 16 '15 #1
0 3376

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Omar Hamido | last post by:
How i can do video capture with c#...more especific, i have a video capture card pci and my question is: if possible to do that... regards... Omar
6
by: Jim | last post by:
Can anybody suggest a starting point for me to learn how to develop a slick interface like TuneUp Utilities (http://www.flickr.com/photos/16037380@N00/80803270/) in VB.Net?
1
by: Israel | last post by:
The problem: I want to know, definitively when a slider loses focus after a user has started sliding and hasn't released the mouse yet. It appears that this is captured with the WM_ACTIVATEAPP...
0
by: teah | last post by:
For eg: i got part A to part D of video, same for my treeview items. theres video A to video D on the treeview. when playing part A of the video, video A of treeview item is highlighted, how do i...
0
by: tayss | last post by:
2. Header << Play Video (a) and (b) on click a) sub header 1 << Play Video (a) only on click b) sub header 2 << Play Video (b) only on click When I click 2....
0
by: MrOnno | last post by:
Hiii, I've a massive list with video links i want to insert into a slider. But all my work so far failed. (I am a amateur) I need a slider with a left and right button, and 4 links in the middle...
1
by: UmairahMohd | last post by:
.theme-default #slider { width:570px; /* Make sure your images are the same size */ height:227px; /* Make sure your images are the same size */ float: right; margin-top: 0px; margin-right:...
0
by: tdrsam | last post by:
I cannot figure out why my slider won't run. I had it working fine, then I tried to make it scroll vertically rather than horizontally and now it's broken, even though I've reset all the settings to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.