You are here

function swftools_flowplayer_swftools_playlist_flowplayer in SWF Tools 6.3

File

flowplayer/swftools_flowplayer.module, line 191
Enables SWF Tools support for Flowplayer.

Code

function swftools_flowplayer_swftools_playlist_flowplayer($data) {
  $xml = '<playlist version="1" xmlns="http://xspf.org/ns/0/">
            <title>' . $xml_data['header']['title'] . '</title>
            <info></info>
            <annotation></annotation>
            <trackList>
            ';
  foreach ($data['othervars']['playlist_data']['playlist'] as $track => $details) {
    if (!isset($details['background']) && strtolower(substr($details['fileurl'], -3, 3)) == 'mp3') {
      if ($data['flashvars']['image']) {
        $source = swftools_get_url_and_path($data['flashvars']['image']);
        $details['background'] = "<image>" . $source['fileurl'] . "</image>\n";
      }
      else {

        //$details['background'] = url(drupal_get_path('module', 'swftools') . '/' . SWFTOOLS_DEFAULT_BG, array('absolute' => TRUE));
        $details['background'] = '';
      }
    }
    $xml .= "<track>\n";
    $xml .= "<title>" . $details['title'] . "</title>\n";
    $xml .= "<creator></creator>\n";
    $xml .= "<location>" . $details['fileurl'] . "</location>\n";
    $xml .= $details['background'];
    $xml .= "<info>" . $details['fileurl'] . "</info>\n";
    $xml .= "</track>\n";
  }
  $xml .= '</trackList>
           </playlist>';
  return $xml;
}