Needs work
Project:
Flowplayer API
Version:
6.x-1.0-beta1
Component:
Miscellaneous
Priority:
Critical
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 May 2010 at 12:14 UTC
Updated:
19 Jul 2012 at 15:00 UTC
Which file should I edit to add some plugins I want ..
Please help
thanks
Comments
Comment #1
carlop commented+1 i'm also interested in add plugins to flowplayer
Comment #2
dellis commented+1
Comment #3
prabhakarsun commentedI tried using this;
To add Yume plugin. However, it's not working for viral. Icons are displayed, but they don't work.
Comment #4
alienresident commentedI have been successful in adding the flowplayer viral video plugin to my flowplayer and I thought I would share that.
First of all the viral video player only works with flowplayer 3.2+
So you need to update all your existing flowplayer files (flowpalyer/flowplayer) to the latest versions from http://flowplayer.org
Make sure the you also download theflowplayer.viralvideos.swf from http://flowplayer.org/plugins/flash/viralvideos.html
Apply this patch http://drupal.org/node/795036#comment-2950112 to make flowpalyer module work with 3.2.+
If you are getting a
300: Player initialization failed: ReferenceError: Error #1069error, clear you drupal and browser cache, see http://drupal.org/node/828302Note: I am using the video module to create a cck filefield (field_video) and have the video upload module enabled.
http://drupal.org/project/video
I have a preprocess_page function in template.php (Replace MYTHEME_preprocess_page with the name of your theme. i.e. garland_preprocess_page).
Then on the node.tpl.php
Comment #5
bcobin commentedThank you alienresident - this is exactly what I'm trying to do, but I'm unclear as to where the code goes - pasting it into template.php breaks the site, with or without the php tags.
Could you possibly more descriptive of exactly how to get the viral plug-in working? It looks like I've successfully updated to 3.2.5 by renaming the new files to match the old names.
Thanks much!
Comment #6
alienresident commentedSorry bcobin
The code in template.php should have been wrapped in a preprocess_page function. I have fixed it now in the example above. Send me a message directly if you still have trouble.
Comment #7
yan commented#4 answered the question.
Comment #9
sven_xo commentedHow can i add plugins like the ipad/iphone Plugin?
This Plugins havent a new. swf file, only a new .js.
Comment #10
sven_xo commentedComment #11
naeluh commented@ alienresident
I am using blueprint theme and it already has a MYTHEME_preprocess_page function. I tried to include it in with other but I am not returning any results.
Is there something I can do? Also where do you put the viral.videos swf file to get it to recognize it
thanks
Comment #12
alienresident commented@ naeluh
Did you do the last step adding the $video_player variable to node.tpl.php?
Then on the node.tpl.php
The viral video plug should go in the flowplayer folder with in the flowplayer module
sites/all/modules/flowplayer/flowplayer/
sites/all/modules/flowplayer/flowplayer/flowplayer.viralvideos.swf
Let me know if you are still having issues.
Comment #13
naeluh commented@ alienresident
awesome thanks for the quick response
Yes I added it to the node.
Awesome that is where I added the flowplayer.viralvideos.swf
I already have a blueprint_preprocess_page function in my template.php file.
I already have this function in there.
How would I add a second preprocess_page function to the template.php file cause I get an error white screen that say the preprocess_page cannot be declared twice.
thanks so much!
Comment #14
alienresident commented@ naeluh
Yes, you can't have two functions named the same!
Paste this in at the bottom of your theme's preprocessor function see example
CODE TO PASTE
This way you are just extending your preprocessor function.
Note: I rename all the $variables in my code $vars to match the blueprint style, so make sure you copy this code and not the top example
Don't forget to clear you cache and theme registry just in case.
Comment #15
naeluh commentedthanks
I added the code and cleared the cache
I added the code below tod the node.tpl.php file and it displays just the title of the node.
When I put this
print $contentin the node.tpl.php file it shows the player and it works good but no viral video share, embed, email links in the player ?I am not sure if its finding the flowplayer.viralvideos.swf I checked the name of the file its right
heres the link to the page in question it contains the node.tpl.php file that is show below
http://www.flaunt.com/flaunt/anna
thanks again for all your help
Comment #16
alienresident commented@naeluh
The flowplayer doesn't seem to be calling the viral video plugin.
If you look at your source you'll see
Where's on the site I worked it's:
I suspect that the theme is still cached in the theme registry and you need to rebuild that and not just empty drupal's cache or the browser's cache
http://drupal.org/node/173880#theme-registry
If that works can you let the thread know.
Comment #17
naeluh commentedI just cleared the cache in the performance area and it is still not returning the viral video plugin I cleared the theme registry also again.
Let me know I can provide anymore information to help get this goin. thanks
Comment #18
naeluh commentedIs it possible that its cause my path is /var/www/modules/flowplayer/flowplayer/flowplayer.viralvideos.swf to the plugin?
Comment #19
naeluh commentedWell I switched the path of the modules to /var/www/sites/all/modules/flowplayer/flowplayer/flowplayer.viralvideos.swf and it is still not recognizing the plugin?
thanks again for all your help
Comment #20
alienresident commented@ naeluh
Just looking over your code again.
On your node,tpl.php
The video that's showing is coming from the
$contentnot from$video_playerthat's why there is no viral video plugin.There's an empty div in your code below the video where I think the
$video_playeris trying to work.<div id="vplayer" <="" div="">What might be the issue is that your video cck field has a different name. In my code it's called "field_video"
so where ever you see
$vars['node']->field_videoreplace it with$vars['node']->your_field_video_nameYou can temporarily add this to your page to look into the
field_video arrayand see the valuesPreprocessing is complicated in Drupal. I recommend reading up on it. The best place is probably from the Frontend Drupal book and they have the preprocessing chapter free online.
http://www.informit.com/articles/article.aspx?p=1336146
Comment #21
alienresident commented@ naeluh
Just looking over your code again.
On your node,tpl.php
The video that's showing is coming from the
$contentnot from$video_playerthat's why there is no viral video plugin.There's an empty div in your HTML below the video where I think the
$video_playeris trying to work.<div id="vplayer" <="" div="">What might be the issue is that your video cck field has a different name. In my code it's called "field_video"
so where ever you see
$vars['node']->field_videoreplace it with$vars['node']->your_field_video_nameYou can temporarily add this to your page to look into the
field_video arrayand see the valuesPreprocessing is complicated in Drupal. I recommend reading up on it. The best place is probably from the Frontend Drupal book and they have the preprocessing chapter free online.
http://www.informit.com/articles/article.aspx?p=1336146
Comment #22
naeluh commentedI also noticed that the default sizing in the template.php file is being overridden by the video module, it seems like it is just moving right past the function. -
this is what I have in as the function_preprocess_page -
Comment #23
naeluh commentedWeird something must be happening to that field cause it is not returning any results on the page when I add the
print_r($vars['node']->field_fv);Also I change the template to reflect the field item name and then cleared the cache still no result or change. I am going to look at the link you provided and see if theres any thing else that I can figure out. Let me know if you can think of anything else and thanks again for your help.
Also what video module are you using and do you have swftools installed?
Comment #24
alienresident commented@ naeluh
I am using the video module 6.x-4.2-alpha2 http://drupal.org/project/video and I don't have swftools installed
I was unclear, the code below should go at the end of the preprocessing function (before the last closing brace) in template.php
What you are trying to do is find out the variables of the field_fv that are being send to $content and override them. You'll also want to exclude that field from displaying. Otherwise you'll have 2 videos on the page. Go to http://YOURSITE.COM/admin/content/node-type/YOUR_CONTENT-TYPE/display and check the exclude box on the node field type.
Comment #25
naeluh commentedHere is the ouput of the vars
Array ( [0] => Array ( [fid] => 2416 [uid] => 1 [filename] => Anna_FLAUNT_Web.mp4 [filepath] => sites/default/files/videos/Anna_FLAUNT_Web.mp4 [filemime] => video/mp4 [filesize] => 16659901 [status] => 1 [timestamp] => 1300811650 [list] => 1 [data] => Array ( [dimensions] => 640x480 [player_dimensions] => 640x480 ) [nid] => 614 [view] =>) )
It looks like its the filepath variable is right ?
I turned off the cdn module didn't do anything.
Comment #26
alienresident commentedYes, the filepath is to the local stored video i.e on your site not on a CDN
I haven't worked with the CDN module. I am assuming it's this module http://drupal.org/project/cdn
If you need to get it to work with with the CDN video you'll need to find it's filepath. I would look into all the variables on the node by editing the print_r in the preprocess function to this.
BTW it's much easier to see the variables if you view source on your page. It lays out the variables nicely using whitespace that isn't shown on the page.
You may want to use the devel themer module http://drupal.org/project/devel_themer for all of this, as it's cleaner and easier to read the output, watch the sceencast http://drupal.org/node/209561
Once you found the file path change this part:
The issue queue is not the best way to do this. Hit me up on IRC #drupal-support. I am alienresident there too. I'll be there until about 7pm EST today. However, when it's sorted out, will you post your solution to this issue queue for others, Thanks.
Comment #27
lismail commentedsubscribing
Comment #28
Rhino commentedsubscribing
Comment #29
Jacob commented+1