I need to modify the autoplay settings (for an swf played in flowplayer3) on a per-page-load basis.
Currently I have a hack where I tweak the flowplayer3_mediaplayer[clip][autoPlay] value in the `variables` table in a hook_boot() function, but that's only really going to work when I demo the site (once multiple users are on at the same time, that will no longer be optimal).
I am looking for a way to directly modify the player instance before it plays. Judging from the documentation, one would typically (in a non-drupal situation) modify the javascript used in the player invocation, but I have not as of yet figured out how to hack this module to do that.
Any pointers would be greatly appreciated, I am not married to flowplayer if that's the issue.
Comments
Comment #1
Mike_Waters commentedSince this question is a no-go, can anyone instead point me to some code that interacts with the player (in a drupal system), so that I can adapt it?
I can't instantiate the player in the normal fashion, b/c it is drupal-ized.
Thanks.
Comment #2
Stuart Greenfield commentedIt's not a no go, but it would need you to use PHP to place the player on the page.
If you are placing your player using the input format [swf] then there are two issues - the player doesn't know the context it is being placed in, and the result of the filter is cached, so you get the standard player.
If you use PHP then you could examine what is being displayer (a teaser, a full node etc) and then assign different parameters to configuration when you call
swf(). The format of the function is documented in the handbook (admittedly it' not a full set of docs yet though).The PHP could be placed either as part of the node, or in a template if you are doing things that way.
A couple of notes for the future. As part of the update I'm looking at implementing some hooks to allow other modules to manipulate the player before it is displayed (although that might not work with the input filter because of caching).
Secondly, the autoplay setting has a different name in different players as in the current format the input filter looks for variables that are specific to the player. As part of the update I'm planning to make a few parameters generic so that they stay the same irrespective of which player you target. Autoplay would be one of those settings.
Comment #3
Mike_Waters commentedThank you; I was looking at Flowplayer3-specific documentation (being instantiated via javascript).
I will look at these docs and experiment.
I appreciate your work.
Thank you,
-Mike Waters