Maybe not the best title, however the effect that I am having trouble creating is:
- slideshow of a number of videos
- each video plays entirely
- after the final video plays, the first starts playing again
The problem that I have is that videos are rotating after the transition delay regardless if the video is finished. If I set the transition delay to 0, the videos do not rotate.
Has this been accomplished before?
Comments
Comment #1
redndahead commentedYou should turn on pause on click. This will keep it from rotating when someone clicks the video. As far as starting the slideshow after the video is over you would have to create custom functionality in whatever player you are using. There is no way for views slideshow to know that the video is finished.
Comment #2
waverate commentedThanks for the quick reply.
If we add a duration field to each node, can that be used to rotate the video on different durations?
Comment #3
redndahead commentedYou would have to use the timeoutFn advanced function and then pull that value from your view. You can set it to display: none and then use jQuery to get that value. You can see the code that is used here http://jquery.malsup.com/cycle/timeout.html
Comment #4
drclaw commentedI wanted similar functionality so I attempted a patch that integrates a dynamic timeout into views slideshow cycle. You can find it here: http://drupal.org/node/1541254#comment-5898154
Comment #5
therealwebguy commentedThis is a bit of an old topic, but I wanted to share an approach I recently implemented. The use case was there would be slides that would contain HTML5 video and slides that would just contain images. The scenario was:
With this criteria, a few things needed to be considered in order to write the javascript required to make this work.
With your view slideshow configured, you can now implement the following javascript:
I chose to implement this code via a module with a scripts[] include in the .info. Feel free to include this in a fashion that works best for you.
Very open to feedback on this approach.
Comment #6
bloomt commentedThe code above almost works for me, it plays half of my videos. Every other slide shows black.
For example even slides play correctly for the correct duration, odd slides do not play at all and show only a black screen or a non moving still from the video.
Comment #7
nickdickinsonwildere-open if still any issue for anyone.
Comment #8
phildu commentedhello
in first , i'm not really a dev, i understand a part of the code
i try to use this hack but ...
the video is not detect
i try to debug but...
i insert alert(vid.lengtht) to check the var but the result is 0
i 'm sure i have insert a youtube video in a video field in my node
so can you help me please
Comment #9
ledjerdemain commented#5 code is ace! I could not get it to work 100% because I have zero knowledge of code. I copied this code and pasted it into a javascript file which I named startvideo.js thant I added a scripts[] line in the views slideshow jquery cycle info file and... though the videos DO start automatically, it sort of messes up everything else that uses javascript (that's kinda of a deal breaker).
Am I doing something wrong? or is this issue related to the jquery version I'm using?
By the way I was too ignorant for any of these links
https://www.drupal.org/docs/7/api/javascript-api/adding-javascript-to-your-theme-or-module
https://www.drupal.org/docs/7/theming/working-with-javascript-and-jquery
https://www.drupal.org/docs/7/api/javascript-api/managing-javascript-in-drupal-7
So I guess I really need a working example on how to turn this code into a module.
Thanks!