Active
Project:
Flowplayer API
Version:
7.x-1.0-alpha1
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Jul 2011 at 08:54 UTC
Updated:
30 Aug 2013 at 07:58 UTC
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
Comment #1
boobaaOK, this approach is… khm… not the best. I use this one instead:
This works fine, without any touches to the .module.
Comment #2
prasannah.ganeshan commented@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?
Comment #3
stovpow commented@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!
Comment #4
selinav commentedCan you give more details about the location to paste the code please.
Comment #5
RedTop commentedIn 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!
Comment #6
gokuast commented@ 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
Comment #7
gokuast commentedI'm sooooo sorry for wasting everyone's time. It took me a while, but I got! Thank you all so much!
Comment #8
temaruk commentedSimply this core method should be used in the theme function: http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_h...
Comment #9
simone960 commentedcan't follow well.. can someone create a patch and place it here? Thanks.