[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/audio/players/ -> xspf_extended.inc (source)

   1  <?php
   2  // $Id: xspf_extended.inc,v 1.6 2008/01/23 04:35:00 drewish Exp $
   3  
   4  function audio_xspf_extended_audio_player() {
   5    $items['xspf_extended'] = array(
   6      'module'      => 'audio',
   7      'title'       => t('XSPF Web Music Player - Extended'),
   8      'description' => t('Extended version 0.2.3'),
   9      'url'         => t('http://musicplayer.sourceforge.net/'),
  10      'preview'     => 'players/xspf_extended.png',
  11      'formats'     => array('wav', 'mp3'),
  12      'theme_node'  => 'audio_xspf_extended_node_player',
  13      'theme_xspf'  => 'audio_xspf_extended_xspf_player',
  14    );
  15    return $items;
  16  }
  17  
  18  function theme_audio_xspf_extended_node_player($node, $options = array()) {
  19    // make sure it's compatible with the flash player
  20    if (!audio_is_flash_playable($node)) {
  21      return NULL;
  22    }
  23  
  24    $options['song_url'] = check_url($node->url_play);
  25    $options['song_title'] = check_plain($node->audio_tags['title']);
  26  
  27    return audio_xspf_extended_player($options);
  28  }
  29  
  30  function theme_audio_xspf_extended_xspf_player($path, $options = array()) {
  31    $options['playlist_url'] = check_url($path);
  32  
  33    return audio_xspf_extended_player($options);
  34  }
  35  
  36  function audio_xspf_extended_player($options) {
  37    $url = base_path() . drupal_get_path('module', 'audio') .'/players/xspf_extended.swf';
  38    $flashvars = audio_query_string_encode($options);
  39  
  40  $output = <<<EOT
  41  <object type="application/x-shockwave-flash" data="$url" width="350" height="153">
  42    <param name="movie" value="$url" />
  43    <param name="menu" value="false" />
  44    <param name="quality" value="high" />
  45    <param name="FlashVars" value="$flashvars" />
  46    <embed src="$url" flashvars="$flashvars" width="350" height="153" />
  47  </object>
  48  EOT;
  49  
  50    return $output;
  51  }


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7