Is it possible to add functionality to put in HTML splashes and overlays? Or is that already in there?

http://flowplayer.org/demos/skinning/splash-info.html

CommentFileSizeAuthor
#6 551242.patch1.34 KBrobloach

Comments

robloach’s picture

Status: Active » Needs work

Definitely something that would be a great addition. Patches are very much welcome and it probably wouldn't be that difficult to do. If you look at theme_flowplayer, you'll see the creation of the div element. We'd have to pass the thumbnail in there as well as all other elements.

Thanks! I'd love to see a patch come out of this ;-) .

chrism2671’s picture

I've managed to do it with a little hacking! Result is on the frontpage, here:
http://www.wikijob.co.uk

robloach’s picture

What did you end up doing? Would love to see how you managed it.

naero’s picture

I'd love to see the code for this too! Please provide if you can!

aaron’s picture

robloach’s picture

Status: Needs work » Needs review
StatusFileSize
new1.34 KB

$contents.

mewcrazy’s picture

Its working great.

But how can I reach the filenames of my files in "field_video1"?

$node->field_video1[0]['filename'] isnt working.

You can reach my Video Gallery at Lockerz Einladung

jbrown’s picture

Status: Needs review » Reviewed & tested by the community

i'm happy with #6

jbrown’s picture

Status: Reviewed & tested by the community » Fixed
robloach’s picture

Ah! Thanks for committing those! :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

chrism2671’s picture

Ah sorry just spotted you guys requesting code above; if you still need it let me know and I'll dig it up! :-)

that0n3guy’s picture

Hey, so I understand how to hack flowplayer.module and add something like $contents = <img src="myimage.jpg"> to the theme_flowplayer function to create a splash that uses "myimage.jpg", but how do I use this in my own module?

Would I set $contents in nodeapi op=view or something?

marcus_clements’s picture

In case it's useful this snippet for a node template uses an image field as a splash for the video:

<?php if (is_array($field_image) && is_array($field_image[0]) && !empty($field_image[0]['view'])) : ?>
      <?php if (is_array($field_video) && is_array($field_video[0]) && !empty($field_video[0]['view'])) : ?>
        <div class="field-field-video">
          <?php $video = theme(  
            'flowplayer', 
            array('clip' => array('url' => url($field_video[0]['filepath']))), 
            'flowplayer', 
            array(), 
            $field_image[0]['view']);
            print $video; ?>
            
        </div>
      <?php else : ?>
        <div class="field-field-image">
          <?php print $field_image[0]['view']?>
        </div>
      <?php endif;?>
  <?php endif;?>
wonder95’s picture

After looking at the Flowplayer splash page help and the patch above in #6, I'm not seeing how the patch helps achieve what is shown on the Flowplayer page. I have the path to the image I want to use, but when I pass it as $contents to theme_flowplayer(), all I get is just the image with no play button, and then if I click on the image, I get the black screen with the play button and the control bar. What I would like is something like the second example on the Flowplayer page linked above.

In may case, I'm using Video module with Zencoder, and Zencoder generates thumbnail images and returns them, and they're available in the video field (at $video_node->field_video_upload[0]['data']['video_thumb'] in my case). So using this code:

         $config['clip']['url'] = $url;
          $config['clip']['autoPlay'] = FALSE;
          $config['clip']['width'] = 500;
          $splash_image = theme('imagecache', 'flowplayer_splash', $video_node->field_video_upload[0]['data']['video_thumb']);
          $embed_code = theme('flowplayer', $config, 'flowplayer', array(), $splash_image);

I get just the image displayed, which makes sense, since with RobLoach's patch all that's returned is

  return "<div id='$id' $attributes>$contents</div>";

However, if I try to add it as a background image, like so:

          $config['clip']['url'] = $url;
          $config['clip']['autoPlay'] = FALSE;
          $config['clip']['width'] = 500;
          $attributes['style'] = 'background-image:url(/' .$video_node->field_video_upload[0]['data']['video_thumb'] . ')'; 
          $embed_code = theme('flowplayer', $config, 'flowplayer', $attributes);

then I can see the top border of the image behind, but I still get the black/gray empty window with the play button.

Any thoughts on what I need to change to get the splash image to show with the play button?

Thanks.