Hi i have a code that lists mp3 files in a directory.
When the link is clicked i want to play these in a flash mp3 player..
but is this possible and how? any help appreciated... 🙂
Code:
PHP:
$dir = new DirectoryIterator( 'music' );
foreach($dir as $file )
{
if(!$file->isDot() && !$file->isDir() && preg_match("/.mp3/",$file->getFilename())) {
echo "Dosya Adi: "."<a href='".$file->getPath()."/".$file->getFilename()."'>".$file->getFilename()."</a><br>";
echo "Boyut: ".number_format(($file->getSize()/1048576),2)." MB <br>";
echo "Eklemne Tarihi: ".date(" d-m-y ",$file->getCTime())."<br><br>";
}
}
FLASH:
<object type="application/x-shockwave-flash" data="player.swf" id="audioplayer1" height="24" width="290">
<param name="movie" value="player.swf" />
<param name="FlashVars" value="playerID=1&soundFile="CHANGE ON CLICK!!!" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<param name="wmode" value="transparent" />
</object>