Hello,
Great module, have a slideshow based on the upright40 theme running on our homepage. It is currently displaying just embedded youtube videos that play within the same window (similar to your embedded content example). Eventually want to add in images as well. I have 2 questions though that I couldn't find the answer to from searching the tutorials and forums.
1. I would like for the slideshow to rotate through the video's and thumbnails. When I set the slideshow to rotate, and then play a video, it rotates out while it's still playing. Is there any way to stop or pause the slideshow once a video is being played? Additionally, when you choose a new video from the thumbnail list, could it stop the current video and play the newly selected one?
2. I'd like to add a custom thumbnail/preview image for each video based on the "Embedded video custom thumbnail" field, but it keeps pulling in the youtube default preview image. Do I have to set this in the preprocess function?, and if so can you point me to the correct code or tutorial for how to do that? May want to eventually embed video's from different sources besides youtube.
Been trying to figure these 2 things out for a while and just wanted to make sure this functionality is possible. If not, can you suggest a different process that maybe I'm missing and would work better?
Thanks in advance,
John
About pausing
Hello, about playing videos in the slideshow, I am trying to pause the rotator when the video is playing using flowplayer. The event handler from flowplayer is working, since I can put any other jquery code and it is executed when the video starts, but when I use cycle('pause') nothing happens, the slideshow keeps rotating.
flowplayer("player", "/drupal-6.16/sites/all/modules/flowplayer/flowplayer/flowplayer.swf", { clip: { autoPlay: false, onBegin: function () { $('#ddblock-3').cycle('pause'); } } });I don't know if I'm using the wrong block to call the cycle, or if I have to do something before using it; in my case the #ddblock-3 is the id of the container of the pager and the slides.
Re: about pausing
You could try:
// stop slideshow when video is started used with flowplayer $f(opts.currSlide).onStart(function() { $container.cycle('pause'); });in the onAfter function of the ddblock.js file
Hope this helps you further, please let me know.
Code in ddblock.js
Thanks for the fast reply :)
I went and put the code where you told me, but it's not working. Looking at the error console of Firefox it says:
Error: $f(opts.currSlide) is undefined
Source File: http://localhost/drupal-6.16/sites/all/modules/ddblock/js/ddblock.js?t
Line: 117
Where line 117 is where I pasted the code you said.
Right now I have:
<script src="sites/default/files/mediaplayer/flowplayer-3.1.4.min.js"></script> <?php theme('flowplayer'); ?>In my page.tpl.php to load all the stuff flowplayer needs, so if I put methods there, they will be recognized.
Do I have to do a different setup in any other place, so ddblock can use the flowplayer methods?
Also I was looking at the code, and there is no $container variable defined in that method (it is defined later on the code), so should I have to define it there? If yes, how?
Thanks a lot for the help.
Re: Embedded video - pause/stop rotation & custom thumbnail
John,
1.) For this functionality would need to write some custom code to stop the slideshow when a slide is choosen (play a video). Did not do this yet, that's why I don't use the slideshow functionality in the example. This is surely doable. When using images and videos would need some javascript to find out if slide is a video or an image.
2.) This can be done in the preprocess functions.
You can use the following code for this:
// add youtube video thumbnail from stored image if (!$slider_items[$key1]['slide_image'] && module_exists('emthumb')){ $node = node_load($result->nid); $field_type = 'field_embedded_video_url'; // the field name used in the content type as video field $item = $node->{$field_type}[0]; $field = $system_types['fields'][$field_type]; $field['widget'] = $system_types['content types'][$node->type]['fields'][$field_type]['widget']; $slider_items[$key1]['slide_image'] = theme('emvideo_video_thumbnail_no_link', $field, $item, 'emvideo_embed', $node); }You need to replace the $field_type with the field name used in the content type as video field
Hope this helps you further, please let me know.
Pause/Resume the slideshow...
Hello,
First, thank you for making this great piece of code for me and fellow Drupalers.
I'm using the the current stable release for Drupal 6 (6.x-1.0-rc6). I need to pause the slideshow when a particular link in one slide is clicked. Also, after another link is clicked, the slideshow should resume. Here's the code from my external js:
$(document).ready(function() { $('#slide-video-link-1').click(function(e) { e.preventDefault(); $('.ddblock-cycle-homepage-banner .ddblock-processed').cycle('pause'); $('.number-pager-close').slideDown('normal'); }); $('.number-pager-close').click(function(e) { e.preventDefault(); $('.ddblock-cycle-homepage-banner .ddblock-processed').cycle('resume'); $(this).hide('normal'); }); });I believe that this version uses an older version of cycle plugin which does not support
cycle('toggle');The slideshow pauses and resumes once, but not afterwards. Should I upgrade to the dev version? Please guide me.
This worked out perfect,
This worked out perfect, sorry for the late response. Got caught up with some other projects so I finally got to try it out. Just have to figure out how to adjust the preprocess function to pull the custom image in as the pager thumbnail as well.
Thanks again,
John
Thanks, I haven't had a
Thanks, I haven't had a chance to try it out yet, but I'll certainly let you know how it goes when I do. Appreciate the clarification and help on both issues.
Thanks again,
John
Works fine, but the slideshow doesn't restart
Hi,
I use current dev version of ddblock and FlowPlayer and it works fine, without need to uncomment the "stop slideshow when video is started" code in ddblock.js.
So, a new issue appears: how to restart the slideshow when user chooses to go another slide than the video one... That 's not very important for me, but it can be useful.
Sincerely,
Daniel Berthereau
Knowledge manager