CCK Audio?

Events happening in the community are now at Drupal community events on www.drupal.org.
jnicola's picture

Hey everyone!

Trying to sort out a way to work with audio files and CCK. I've got a project I'm helping out with, where users will put audio files in, and it would be nice if they could be played right on the node.

I found imagefield, and media field display... however media field display doesn't appear to work in regards to having the audio file available in say a flash player of some variety. Is there some hidden module(s) out here which works particularly well for allowing CCK audio file fields, and having them made available in a flash player? Also, video support would be appreciated too.

Help is appreciated, and the offer for trading beer for your much appreciated knowledge is always a standing offer!

Thanks,
Jesse

Comments

Filefield, Filefield Meta, 1pixelout

grendzy's picture

I use Filefield and Filefield Meta (which is included with filefield).

Then I dropped this in my theme's template.php:

<?php
/**
* Theme function for the 'generic' single file formatter.
*/
function mytheme_filefield_file($file) {
  if (
$file['filemime'] == 'audio/mpeg') {
   
$path = $file['filepath'];
   
$embed = '<div class="filefield-file clear-block"><script language="JavaScript" src="' . url(path_to_theme() . '/1pixelout/audio-player.js') . '"></script><object type="application/x-shockwave-flash" data="' . url(path_to_theme() . '/1pixelout/player.swf') . '" id="audioplayer1" height="24" width="290"><param name="movie" value="' . url(path_to_theme() . '/1pixelout/player.swf') . '"><param name="FlashVars" value="playerID=1&amp;soundFile=' . file_create_url($path) . '"><param name="quality" value="high"><param name="menu" value="false"><param name="wmode" value="transparent"></object></div>';
    return
$embed;
  }
  else {
    return
theme_filefield_file($file);
  }
}
?>

Quick and easy. (You'll also need the 1pixelout player in your theme folder.) A more sophisticated approach would be to define a custom formatter. Look into hook_field_formatter_info() if that interests you.

Hmm... doesn't seem to be

jnicola's picture

Hmm... doesn't seem to be working for me.

The SWFtools supposedly has CCK field support (See module here). It infact says: "When you create a filefield you can assign SWF Tools as the field formatter". However, I'm not seeing any of that when I create a file filed. Any idea if it's not as simple as drag and drop, or what's the deal?

I'm surprised there isn't a straight forward plug and play CCK audio/video support for this. Then again, it wouldn't be drupal without some tinkering :)

The dude responsible for -- Mt Hood Snow Sports --

Jesse Nicola -- Shredical six different ways to Sunday! -- My Portfolio

FileField Podcaster

wonder95's picture

I haven't used it myself, but have you seen the FileField Podcaster module? It's used by Geeks and God for their podcasts and seems to work pretty well (they describe it in one of their episodes).

FFPC

grendzy's picture

Yes, I use FFPC with the approach mentioned above. The FFPC module just generates the RSS feed; I used it in addition to the 1pixelout player. SWFTools looks promising as well.

Hey everyone, just an

jnicola's picture

Hey everyone, just an update.

SWF tools wasn't that functional in drupal five, however it's damn near perfect in drupal 6! I keep finding myself resorting to drupal 6 as the module functionality seems a bit more consistent for me lately.

Anyways, thanks everyone for your time, it's been much appreciated!

The dude responsible for -- Mt Hood Snow Sports --

Jesse Nicola -- Shredical six different ways to Sunday! -- My Portfolio

Portland (Oregon)

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week