Custom Formatter: ffmp3播放器

$url = ($element['#item']['safe']); $title = $element['#node']->title; $skin = '/sites/all/libraries/ffmp3/ffmp3-repvku-100.xml';

  // Creates a new object wrapping the given file (path)
  $swf = new SWFObject('/sites/all/libraries/ffmp3/ffmp3-config.swf');

  // With that object, first we add a param to allow full screen.
  $swf->param('scale', 'noscale')
    // Add another param to set the type to movie.

    // Set some flash variables, beginning with the aspect ratio...
    ->flashVar('codec', 'mp3')
    // Set volume variable
    ->flashVar('volume', 90)
    // Set video source
    ->flashVar("url", $url)
    ->flashVar("title", $title)
    ->flashVar("skin", $skin)
    ->flashVar("autoplay", 'true')

    // Set the height and width of the player.

    // Set a message for non-Flash capable clients.
    ->noFlash('Install flash please.')

   // Declare the minimal Flash version required for this object.

  // Theme the object and return that to the client.
  return theme('swfembed_embed', $swf);