私は実際にこの言及されたタイトルに取り組んでいます。プレーヤーはリストを表示し、完全に生成します。しかし、実際にそのファイルを再生する場所はありません。どこか間違っているに違いない。私はキツネに助言する必要があります。(ああ、ファイルを添付できれば。)
my class
class DecodDir
{
function getFiles($directory)
{
$all_files = array();
$handler = opendir($directory);
while($files=readdir($handler))
{
if($files!="." && $files!="..")
{
$all_files[]= $files;
}
}
closedir($handler);
return $all_files;
}
}
################# file where i am using this class *###############
<?php
include("decoddir.php");
$obj = new DecodDir();
$results = $obj->getFiles("mp3");
$total = count($results);
$string = "";
for($i=0; $i<$total; $i++){
$string .="
{
name:'$results[$i]',
mp3:'mp3/$results[$i]',
ogg:'$results[$i]'
},
";
}
?>
// its at the top of that html file (ofcorse with the php ext)
and below, this is where it is generating the playlist
var audioPlaylist = new Playlist("2", [
<?php echo $string; ?>
],
http://www.jplayer.org/latest/demo-02/ (jplayer の入手先のリンク) プレイリスト付きのオーディオ プレーヤーを見ることができます。(実際には、ここのスタックオーバーフローのコードをホットフォーマットすることは知りません)Rafayに感謝します