I'm following the instructions on the project page on theming the player.

Following the example, I'm trying to override the global defaults like this:

<?php jq_add('jquery_media', array('bgcolor' => '#33FF00', 'media width' => 200, 'media height' => 20, 'autoplay' => TRUE));  print l($node->title, $node->field_file_field[0]['filepath'], array('class' => 'media'));
?>

I've put this in my node.tpl.php and it's showing the player, but I'm getting just the standard player and the extra options are having no effect.

Comments

heacu’s picture

hello,

i tried

jq_add('jquery_media', array('media width' => 400, 'media height' => 16));
print l($node->title, $node->field_ffaudio[0]['filepath'], array('attributes'=>array('class'=>'media')));

the second line works, but not the first. maybe the first also needs fixing? like, array('options'=>array('media width'....???

edward

joachim’s picture

The call to jq_add is definitely right -- I've just chased the variables through the code.
The javascript generated by line 140ish of jquery_media.jq.inc is:

    $.fn.media.defaults.autoplay = 1;
    $.fn.media.defaults.bgColor = '#33FF00';
    $('a.media, .filefield-item a').media( { width: 200, height: 20 } );

so the height is getting passed in.
It's just not having an effect; nor is the background colour or anything else.

smatte’s picture

Title: can't get theming to work » I am getting 'Fatal error: Call to undefined function jq_add() '

Hi,
I am displaying the node with all the details written in node-node type.tpl.php file. For this node some video files are there, So I want to diplay those media files for this I downloaded and installed the jQuery Media module.

And downloaded the 'JW FLV Player' but I dont know how to install this player??? What I did was simply copied the player.swf and swfobject.js into the project folder is it the right way to install???

In the jQuery media settings
1. Check the node type where the plugin will activate
2. In the media default (check box for 'Auto-invoke Media class' is selected) and in the Media class '.filefield-file a' this value is there.
3. in the default players for 'Flash Player (flvPlayer):' I gave player.swf and for MP3 player also I gave player.swf (copied from the JW FLV Player into the current project folder).

Remaining all are the default values.

Now in the node-type.tpl.php file I used the following 2 lines

jq_add('jquery_media');
print l($str_filename, $str_filepath, array('attributes'=>array('class'=>'media')));

Now When I am viewing that perticular node
it showing "Fatal error: Call to undefined function jq_add() in C:\xampp\htdocs\drupal6\themes\garland\node-venue.tpl.php on line 97"

Can you please tell me where was the mistake.... Urgent

Thanks in advance