Kullanıcı şarkı seçtiğinde aslında benim web www.musicking.in bir oyuncu bir pencere açılacak ve bu gelen seçilmiş şarkılar xml çalma listesini erişecek ve oyuncu bu şarkıları çalacak.
aslında onun iyi çalışıyor. pek çok kullanıcı, seçilen şarkıları çalmaya değil çaları accesiing zaman ama bazen sorun ya, onun oyun şarkıları önceden o seçilmiş ya da hiçbir şey.
{my player code}
<?php
if(isset($_POST["song"])&& $_POST['song'] != "")
{
$song = $_POST["song"];
}
else {$song=array();}
$dom = new DOMDocument("1.0");
// display document in browser as plain text
// for readability purposes
// create root element
$root = $dom->createElement("playlist");
$dom->appendChild($root);
$root->setAttribute('version', "1");
$root->setAttribute('xmlns', "http://xspf.org/ns/0/");
$rootnext = $dom->createElement("trackList");
$root->appendChild($rootnext);
foreach ($song as $counter) {
$tokens = ",";
$tokenized = strtok($counter, $tokens);
// create child element
$song = $dom->createElement("track");
$rootnext->appendChild($song);
$song1 = $dom->createElement("creator");
$song->appendChild($song1);
$text = $dom->createTextNode("www.musicking.in");
$song1->appendChild($text);
$song1 = $dom->createElement("title");
$song->appendChild($song1);
// create text node
$text = $dom->createTextNode($tokenized);
$song1->appendChild($text);
$tokenized = strtok($tokens);
$song1 = $dom->createElement("location");
$song->appendChild($song1);
$text = $dom->createTextNode($tokenized);
$song1->appendChild($text);
}
// save
$dom->save("playlist.xml");
?>
<object data="musicplayer.swf?autostart=true&playlist=playlist.xml" type="application/x-shockwave-flash" width="400" height="300"><param name="movie" value="musicplayer.swf?autostart=true&playlist=playlist.xml"/></object>
{sample playlist.xml}
<?xml version="1.0"?>
<playlist xmlns="http://xspf.org/ns/0/" version="1"><trackList><track><creator>www.musicking.in</creator><title>Ey Yavo </title><location>/telugusongs/prayanam/Ey Yavo.mp3</location></track><track><creator>www.musicking.in</creator><title>Meghamaa </title><location>/telugusongs/prayanam/Meghamaa.mp3</location></track><track><creator>www.musicking.in</creator><title>Nuvvu Entha </title><location>/telugusongs/prayanam/Nuvvu Entha.mp3</location></track></trackList></playlist>
i kodları aşağıda denedim ama çalışmıyor
changed {player.php}
if(isset($_POST["song"])&& $_POST['song'] != "")
{
$song = $_POST["song"];
}
else {$song=array();}
<object data="musicplayer.swf?autostart=true&playlist=playlist.php?song=<?=$song; ?>" type="application/x-shockwave-flash" width="400" height="300"><param name="movie" value="musicplayer.swf?autostart=true&playlist=playlist.php?song=<?=$song; ?>"/></object>
{player.php}
<?php
if(isset($_POST["song"])&& $_POST['song'] != "")
{
$song = $_POST["song"];
}
else {$song=array();}
$dom = new DOMDocument("1.0");
// display document in browser as plain text
// for readability purposes
// create root element
$root = $dom->createElement("playlist");
$dom->appendChild($root);
$root->setAttribute('version', "1");
$root->setAttribute('xmlns', "http://xspf.org/ns/0/");
$rootnext = $dom->createElement("trackList");
$root->appendChild($rootnext);
foreach ($song as $counter) {
$tokens = ",";
$tokenized = strtok($counter, $tokens);
// create child element
$song = $dom->createElement("track");
$rootnext->appendChild($song);
$song1 = $dom->createElement("creator");
$song->appendChild($song1);
$text = $dom->createTextNode("www.musicking.in");
$song1->appendChild($text);
$song1 = $dom->createElement("title");
$song->appendChild($song1);
// create text node
$text = $dom->createTextNode($tokenized);
$song1->appendChild($text);
$tokenized = strtok($tokens);
$song1 = $dom->createElement("location");
$song->appendChild($song1);
$text = $dom->createTextNode($tokenized);
$song1->appendChild($text);
}
// save
echo $dom->saveXML();
?>
<object data="musicplayer.swf?autostart=true&playlist=playlist.xml" type="application/x-shockwave-flash" width="400" height="300"><param name="movie" value="musicplayer.swf?autostart=true&playlist=playlist.xml"/></object>