I was working on a blog-style page which occasionally required more than one flowplayer video contents in a single page. The div id for all of the flowplayers is currently "flowplayer" which causes flowplayer to fail on all but the last video post.

I have modified the code to make it work.

My modifications are:
1. Create a counter variable:

variable_set("flowplayer_videonum", 0);

2. Inside the "theme_flowplayer" function append and increase this counter variable to the div id name:


	$fpVidID = variable_get("flowplayer_videonum");
	$fpVidID ++;
	variable_set("flowplayer_videonum", $fpVidID);

        $config = $variables['config']; // unchanged from existing code
        $id = $variables['id'] . $fpVidID; // variable appended here

This has so far worked well for me.

Comments

boobaa’s picture

OK, this approach is… khm… not the best. I use this one instead:

    $config = array(
      'clip' => array(
        'url' => $url0,
        'autoPlay' => FALSE,
      ),
    );
    print theme('flowplayer', array('id' => 'flowplayer-0', 'config' => $config, 'attributes' => array('style' => 'width:540px;height:405px;')));
    $config['clip']['url'] = $url1;
    print theme('flowplayer', array('id' => 'flowplayer-1', 'config' => $config, 'attributes' => array('style' => 'width:540px;height:405px;')));

This works fine, without any touches to the .module.

prasannah.ganeshan’s picture

@Boobaa I just referred to your solution. But ins;t it only adding settings for just two videos? What is I need anything more than that?

Do I repeat it to all the number videos?

stovpow’s picture

@okhrana, thank you very much for this solution, it works beautifully. I worked for 2 days trying to do this and you just saved me. Thank you!

selinav’s picture

Can you give more details about the location to paste the code please.

RedTop’s picture

In flowplayer.module look for the line containing (disregard the php tags, just here for syntax highlighting.):
function theme_flowplayer($variables) {

Past the first bit before this line, paste the second bit after this line.

Works beautifully, +1 for commit!

gokuast’s picture

@ RedTop, if you can. Please give just a bit more info. I don't really understand what you mean when you say paste the first bit and the second bit. Not sure which is which. Secondly, EVERYTHING I have tried is killing my views. things are coming out crazy. I would like to just use the flowplayer. I am using the Video module. and like many who are having this problem I am only getting one flowplayer to show. And when I use Views...Yet again only the last player shows. I hope U or one of my Drupal friends can help.

Cheers

gokuast’s picture

I'm sooooo sorry for wasting everyone's time. It took me a while, but I got! Thank you all so much!

temaruk’s picture

Simply this core method should be used in the theme function: http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_h...

simone960’s picture

can't follow well.. can someone create a patch and place it here? Thanks.