function swftools_wijering4_mediaplayer_playlist in SWF Tools 6
Same name and namespace in other branches
- 5 wijering4/wijering4.module \swftools_wijering4_mediaplayer_playlist()
File
- wijering4/
wijering4.module, line 224
Code
function swftools_wijering4_mediaplayer_playlist($xml_data, &$method, &$vars) {
$xml = '<playlist version="1" xmlns="http://xspf.org/ns/0/">
<title>' . $xml_data['header']['title'] . '</title>
<info></info>
<annotation></annotation>
<trackList>
';
foreach ($xml_data['playlist'] as $track => $details) {
if (!isset($details['background']) && strtolower(substr($details['fileurl'], -3, 3)) == 'mp3') {
if (isset($vars->flashvars['image'])) {
$details['background'] = swftools_get_media_url(swftools_get_media_path() . $vars->flashvars['image']);
}
else {
$details['background'] = SWFTOOLS_DEFAULT_BG;
}
}
$xml .= "<track>\n";
$xml .= "<title>" . $details['title'] . "</title>\n";
$xml .= "<creator></creator>\n";
$xml .= "<location>" . $details['fileurl'] . "</location>\n";
$xml .= "<image>" . $details['background'] . "</image>\n";
$xml .= "<info>" . $details['fileurl'] . "</info>\n";
$xml .= "</track>\n";
}
$xml .= '</trackList>
</playlist>';
return $xml;
}