Today I added a small block to my site with a view that had a single audio node. I wanted all pages on the site to show the most recent podcast on the site. However, while the 1pixelout player works best for my teasers and nodes, I'd really rather have the XSPFbutton in the sidebar due to the way that the 1pixelout player expands beyond the width of my sidebar.

The attached patch provides this feature by adding several more handler functions for the "Audio: Player link/flash" field. These extra functions call a modified version of audio_get_node_player with a specific (though optional) $type. The updated function audio_get_node_player($node, $type = NULL) {
will use the right player for the situation for backwards compatibility, but will use a specific player as requested in the optional second function argument.

Comments

drewish’s picture

can't you use audio_get_players() to get a list of installed players and build the list of handlers that way?

greggles’s picture

Since the handler array is keyed by the function name, I'm not sure if that is possible.

I agree this solution is overly rigid, but 1) it's more flexible than the current situation and 2) I don't see a way to make it more dynamic.

greggles’s picture

Status: Needs review » Needs work

apparently this can be done automatically using something like http://drupal.org/node/99792 option fields that are select lists.

yay! (though I'm doubtful to work on this for a while at least...my need is solved boo to myself)

drewish’s picture

StatusFileSize
new2.56 KB

how's this look?

drewish’s picture

Status: Needs work » Needs review
drewish’s picture

Status: Needs review » Fixed

committed to HEAD and DRUPAL-5

Anonymous’s picture

Status: Fixed » Closed (fixed)
sitarane’s picture

hello

that's exactly what i need, turn the player into buton player just in the block.

I'm a newbie so my question is just

what to do with the patch you give to make things work?

thank you