Bonjour,
I tried in a template like node--NID.tpl.php:

#1 > $video = theme(flowplayer, '/path-to/video.flv'); 
echo $video;

#2 > $video = theme(flowplayer, array('clip' => array( 'url' => '/path-to/video.flv'),)); 
echo $video;

#3 > $video = '<a href="/path-to/video.flv" id="player" class="flowplayer"></a>';
		  flowplayer_add('#player', array(
		    'clip' => array(
		      'autoPlay' => FALSE
		    ),
		  )); 
echo $video;

The #1 crash my site => display a html page without nothing in the <head> tag.
The #2 displayed well the page but didn't find the video (relative or absolute path). Didn't print any path in the js by the way.
The #3 worked for me.

Maybe I missed something in the use of the theme() function for flowplayer ?

Comments

mototribe’s picture

have the same problem, #3 worked, thanks!

djbucci’s picture

+1

Exact same issue as well with exact same symptoms.

ralva83638’s picture

I had the same issue using a global php field in a view display, saw this in the sys log:

httpd: PHP Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /../sites/all/modules/flowplayer/flowplayer.module on line 231

#3 above worked fine.

wolf_22’s picture

SO...

theme() isn't working with this or what? Has anyone successfully used theme()? Whenever I use flowplayer_add(), nothing from the flowplayer admin interface seems to carry-over, such as the controls...

j_ten_man’s picture

Component: Code » Documentation
Category: bug » support

The documentation on the module page must be for Drupal 6 version. Here's the correct way to get this to work based off the 2 examples from above:


theme('flowplayer', array('config' => '/path-to/video.flv')); 

theme(flowplayer, array('config' => array('clip' => array( 'url' => '/path-to/video.flv')))); 

// Here's an example with all of the parameters that you can pass to the call.
theme('flowplayer', array('config' => $clip, 'id' => $id, 'attributes' => $attributes));

In other words, take what you were passing in for the clip, and pass it in as the 'config' key of the array.