当前位置

Custom Formatter: ffmp3播放器

simon的头像
simon 在 周六, 04/21/2012 - 06:02 提交
$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.
    ->param('wmode','transparent')

    // 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.
    ->height(25)
    ->width(100)

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

   // Declare the minimal Flash version required for this object.
    ->minimumVersion('9.0.28');

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