When I themed the 1pixelout flash player for the Geeks and God podcast I couldn't find any good documentation on how to theme the player. Since I was under the gun for time I just manually built it into the site and cut the audio module out from displaying the player. This is a hack. So, let me share the right way to go about this which happens to be the easier way.
The 1pixelout player is themed by the function theme_audio_1pixelout_node_player so we need to start by creating the theme function phptemplate_audio_1pixelout_node_player or mythemename_audio_1pixelout_node_player in our template.php file. Normally, I would start with the original code and make modifications. In this case we're not going to do that. We start with a function that looks like:
<?php
function phptemplate_audio_1pixelout_node_player($node, $options = array()) {
return theme_audio_1pixelout_node_player($node, $options);
}
?>theme_audio_1pixelout_node_player is still going to do the heavy lifting for us (i.e., the theming) which is why we return the output of that function. We are going to modify the options which is what will theme the player.
![]()
This image displays all the themable regions
To theme the player lets look at the list of available options.
- autostart=yes - The player will automatically open and start to play the track (default value is no)
- loop=yes - The track will be looped indefinitely (default value is no)
- bg=0xHHHHHH - Background colour option (where HHHHHH is a valid hexadecimal colour value such as FFFFFF or 009933)
- leftbg=0xHHHHHH - Left background colour
- rightbg=0xHHHHHH - Right background colour
- rightbghover=0xHHHHHH - Right background colour (hover)
- lefticon=0xHHHHHH - Left icon colour
- righticon=0xHHHHHH - Right icon colour
- righticonhover=0xHHHHHH - Right icon colour (hover)
- text=0xHHHHHH - Text colour
- slider=0xHHHHHH - Slider colour
- loader=0xHHHHHH - Loader bar colour
- track=0xHHHHHH - Progress track colour
- border=0xHHHHHH - Progress track border colour
From here it's easy. Let's say we want the right and left backgrounds to be black and the right and left icons to be white. Our function would look like:
<?php
function phptemplate_audio_1pixelout_node_player($node, $options = array()) {
$options['leftbg'] = '0x000000';
$options['rightbg'] = '0x000000';
$options['lefticon'] = '0xFFFFFF';
$options['righticon'] = '0xFFFFFF';
return theme_audio_1pixelout_node_player($node, $options);
}
?>It's as simple as having the variable in the array and the value as it's value for each option. Anything we don't theme will show up with the default colors.


Thank you...
...for information that I could not find ANYWHERE else. It's too bad I overlooked this post several times before discovering that it's exactly what I needed.
Btw, I'm not a church person although I have, and I hesitate to call it this, a "personal faith". However, I am a geek, and I find that your podcasts are very informative, and for someone who has a near allergic reaction to very religious people, it is extremely tolerable.
The interaction between you guys is perfect. I imagine that the two of you are very good friends who can barely stand each other at times, but would never let that get in the way. It makes for an entertaining and very informative few minutes, and you've made my day several times already. I haven't listened to very many episodes, so that's saying something.
Thanks. I imagine that, along with the obvious target audience, I am just the type of person you are trying to reach. Well done.
Your Welcome
We are glad we could help.
Not all Christians are crazy and creepy. Though, I am not sure if I am sane or un-creepy ;-). Is un-creepy even a word?
Bob and I are great friends. He is the best man in my upcoming wedding.
Congratulations...
...to both of you. I was a best man only once. I had prepared a toast, and when the time came I forgot everything I had planned on saying. I winged it, nervously, and fortunately the words that came to mind ended up being much better than those I had originally intended. Everyone stood and applauded which is much more than I had expected. Lesson learned.
Thanks again,
Roger
I'm impressed with your
I'm impressed with your post. It would be nice to commit this somewhere to http://drupal.org (maybe to docs of the audio module)
on my to do list
Thanks. Moving this info over is on my long list of to dos.... along with documenting the other flash player.
update suggestion
I would suggest just an update. If you set up width and height options, you could also change the size of the player, although in version 1 it will just scale up or down.
With new 1pixelout player, version 2 beta, it can even be resized in width, so it is a much more customizable player (that also includes a volume control). Maybe it worths to give it a tr. You can check how it works at my cuentos infantiles site.