jquerymedia: player size wrong: seperate mp3 and video player?
-Anti- - March 12, 2009 - 21:52
| Project: | jQuery Media |
| Version: | 6.x-1.4-beta1 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
At the moment, everything is playing at 400x400.
Obviously that is far too large for an mp3.
Can anyone show me how to get mp3's played in a smaller player than video?
Thanks.

#1
Bump.
I've got a separate mp3 player and video player (both JW players).
I need to tell the mp3player to be 400x30px and the video player to be 600x400px.
But I don't see how to send separate flashvars or params to the players from the admin page?
There seems to be only *one* default setting for *both* players?
If that's the case, I don't understand the point of specifying the flv and mp3 players separately?
Surely for two players it makes sense to be able to give therm different flashvars and params?
Can anyone assist? I'm quite desperate to get this working.
BTW, I'm using FCKEditor: the user just links to the uploaded mp3 or flv file, and then
adds 'media' as the css class, which jquerymedia then embeds automatically.
It is too much to ask my users (who are school children) to include vars in the FCKeditor body,
and anyway, I don't think FCKeditor would allow that.
Thanks.
#2
bumping this.
I still don't see the point in specifying a separate mp3 player and video player
if they both have to use the same dimensions and share the same flashvars.
Thanks.
#3
I have done this before by doing the following:
1. I have two file fields called audio_file and video_file (this is just as an example you can have any any amount of fields with any names)
2. In your template.php file override the theme_filefield function so that your audio and video fields have different css classes.
For example (again you might want to make this different depending on how you set up your fields and if you have more unrelated file fields or use a different method of distinguishing between the file types):
<?php
function theme_filefield($file) {
$node = node_load($file['nid']);
if (user_access('view filefield uploads') && is_file($file['filepath']) && $file['list']) {
$path = ($file['fid'] == 'upload')
? file_create_filename($file['filename'], file_create_path($field['widget']['file_path']))
: $file['filepath'];
$icon = theme('filefield_icon', $file);
$url = file_create_url($path);
$desc = $file['description'];
if (substr($file['filemime'], 0, 5) == 'audio') {
$output = '<div class="filefield-item media-audio">'. l($desc, $url) .'</div>';
}
else {
$output = '<div class="filefield-item media-video">'. l($desc, $url) .'</div>';
}
return $output;
}
else {
return '';
}
}
?>
3. In a nodeapi function somewhere add something like this:
<?phpfunction mymodule_nodeapi (&$node, $op, $a3, $a4) {
switch ($op) {
case 'view':
jq_add('jquery_media', array('invoke media' => TRUE));
drupal_add_js(" $(document).ready(function() { $('.media-audio a').media( { width: ".variable_get('jquery_media_media_width', 400).", height: 20} ); });", 'inline');
break;
}
}
?>
4. In the settings screen for jquery_media, make sure extra settings -> classes -> media -> auto-invoke media class is not checked (your nodeapi takes care of the invoking).
From memory that was all I did and it worked.
This will make it so that anything that is in one of your file fields that has a mime type starting with audio will be rendereed in the different sized media player and everything else will use your normal size settings.
#4
Actually, my solution was done for a Drupal 5 website. But the solution should be pretty similar in 6.
#5
Also, if you don't already have it installed you will need to jq module (http://drupal.org/project/jq) for this solution to work as it provides the jq_add function.
#6
http://drupal.org/node/407510 is a duplicate of this issue.
#7
Thanks for your reply.
However, I'm not using cck fields to add videos.
The user just links to a file they've uploaded via IMCE.
The link is created in FCKeditor. They type 'media' into the stylesheet field.
Jquerymedia 'sniffs' the class in the link and embeds the file.
The manual solution to this is to pass a dimension to the mp3 player
in the FCK 'stylesheet' field, like this (requires the jquery metadata plugin):
media {height:40}
However, this only works if you allow the user full html input format.
For some reason, Drupal strips out the class leaving only: 40}
So, now I'm stuck with playing mp3s in a video player, taking up 640x400.
#8
there really should be options for different content types and file formats.
Do a search for "size" in the issue query and you will find a bunch of relating problems.
Hope this got solved soon, because i really like this module :(