Active
Project:
JW Player Module for Drupal
Version:
6.x-1.1
Component:
Miscellaneous
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Feb 2011 at 20:32 UTC
Updated:
16 Nov 2011 at 09:56 UTC
This is not a bug, rather a finding that I want to share with the community. Perhaps it will save you a few hours of headaches.
You can use this to render a player, using a call to the theme() function.
$flash_vars = array(
'file' => $video_path,
'image' => $video_thumb_path
);
print theme("jwplayermodule_render_player", "[config-name]", $flash_vars);
Except in page.tpl.php (or variant of page.tpl.php).
The function uses drupal_add_js() to insert the required JS for SWObject.
Once at page.tpl.php, the page is already nearly loaded and drupal_add_js() cannot add JS to the page.
A workaround would be to add the above code to a block, and render that block in page.tpl.php.
Hope this helps someone.
Comments
Comment #1
JW Player commented@lookatthosemoose,
Thanks for posting this tip!
Comment #2
teflo commentedThanks lookatthosemoose!