Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is a width setting for the JW media player but not for the 1pixelout player. The new pixel mp3 player supports width, how can I update the module so that I can specify width for the 1pixel out player?
thanks!
Comments
Comment #1
mpolis CreditAttribution: mpolis commentedbeen looking for an answer to this as well. any luck?
Comment #2
chrisfromredfinI really want this to and could probably supply a patch to add this in - I just don't know where in the world to set the width of the 1pixelout player. I can't find it in the 1pixelout documentation at all. Can you point me to it? When I just change the width attribute, it changes the height, too.
Comment #3
bentonboomslang CreditAttribution: bentonboomslang commentedI've made a hack for this problem. On my site users can upload a number of mp3s. In my template.php file I've created the following function. This is called in the node_preprocess function.
This is called when I want to include a player in my *.tpl.php files like so:
This won't be applicable to everyone but hopefully it's of some help to someone. If anyone knows a better way to do this please educate me!
B
Comment #4
joachim CreditAttribution: joachim commentedChanging the size of the 1pixelout player object just makes it look ugly -- I tried this on a site.
The proper solution would be for the player to take a width parameter and draw itself accordingly.
Comment #5
superdorx CreditAttribution: superdorx commentedAny one find a solution here yet? It's almost useless if you can't set the width to fit in your block or where ever you need to place this.
Comment #6
superdorx CreditAttribution: superdorx commentedGood news everyone! http://drupal.org/project/mp3player This module integrates the latest player version and has a width parameter setting. YAY!
Comment #7
joachim CreditAttribution: joachim commentedErm... great, but can we get it supported in SWF tools rather than go back to the D5 situation of having different modules for different media players?
Comment #8
jrefano CreditAttribution: jrefano commentedi tried to modify the source to do this, but no matter what i changed it wanted to show up at 290px. i thought changing the width in the $media_player array in onepixelout_swftools_methods() would do something, but it had no affect. so, does anyone know how to resize this thing? as superduperdan said, its kind of useless to have a player be a fixed width if you want it to have any flexibility for your site design.
Comment #9
soyarma CreditAttribution: soyarma commentedSolution!
This involves modifying the swftools.module file to deal with what I perceive to be an oversight.
The first thing to note is that if you set a width and height value in the $media_player array in the onepixelout.module file, this is essentially ignored. The reason (I imagine) is because you certainly don't want it overriding a param you set manually when calling the swf function in a tpl file or the like.
Most of you have tried to make that change and found it to be ineffectual. The reason is very simple and it lies in the swftools_set_size() function in the swftools.module. This function is called to ensure that both the params and the flashvars width and height are set. First it looks to see if the flashvars are set for width and height. If they are it assigns the same to params. Then the reverse, if flashvars aren't set, then it applies params to flashvars.
However, if neither are set the function then looks at the params set in the src_path for the player. Note: this isn't the mp3, its the .swf player, which (of course) returns 290x24. The function happily takes this return, assigns it to the params width and height (probably should assign it to flashvars too) and then returns.
Below that the system looks to the values set in the player module file (in that $media_player array that seems to be ignored). Well... since the 1pixelout player has it's width and height set in the .swf file, this settings will never, ever be used.
Solution. Move the two bottom if statements above the 3rd if statement. I also adjusted them to set the flashvars height and width as well since they seemed to not set them.
Here's my modification to the swftools_set_size() function:
Voila! now your settings in the onepixelout.module file will actually stick. In theory it wouldn't be that hard to modify that file to make those two settings also be available text fields in the admin section for the player as well.
Comment #10
jaarong CreditAttribution: jaarong commentedI have a problem with this also. Need to set the width on 1pixelout, can we make this an admin setting?
Comment #11
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedHeight and width have been added to the admin page so that it can be over-ridden.
If a different height / width are supplied then these will be used instead when the player is rendered.
This will be committed on branch DRUPAL-6--3 shortly.
Comment #12
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedNow in place on DRUPAL-6--3, so should be working and height/width can be set properly.
Comment #13
pumpkinkid CreditAttribution: pumpkinkid commentedHas anything changed from February that I can't see these new width settings?
Comment #14
szb100 CreditAttribution: szb100 commentedI'd like to know this as well. Has this been rolled into a dev release?
Comment #15
truyenle CreditAttribution: truyenle commentedWell, I tried 6.x-3.0-beta4 and the site crash. Then I have to remove it and fallback with 6.x-2.5
Any update for this issue would be very much appreciated.
Thanks
Truyen
Comment #16
itrain CreditAttribution: itrain commentedAlternatively, you can set the width for the div in the CSS file. That worked for me.
.onepixelout {width: 150px; }
Comment #17
thinkyhead CreditAttribution: thinkyhead commentedThe css method doesn't work for me with swftools 6.x-2.5. Haven't tried the 3.x beta yet.
Comment #18
hefox CreditAttribution: hefox commentedI don't see a patch (needs review implies there's a patch)