I am trying to create a HTML5 playlist using the audiojs plugin. My playlist is in an external XML file as it is managed by a custom CMS:
<playlist>
<item>
<title>bla bla bla</title>
<artist>Big Bla</artist>
<path>/mp3/bla-bla-bla.mp3</path>
</item>
<item>
<title>bla bla blab</title>
<artist>lil Big Bla</artist>
<path>/mp3/bla-bla-bla.mp3</path>
</item>
</playlist>
This is my .php file:
<div id="player-holder">
<audio preload></audio>
<ul>
<li>
<a data-src="track path" href="#">title</a>
</li>
<li>
<a data-src="track path" href="#">title</a>
</li>
<li>
<a data-src="track path" href="#">title</a>
</li>
</ul>
</div>
I need to get the song path from the XML document and add it to the "data-src" attribute, and get the song title and display that as an anchor link.
I have about 6 tracks going into the playlist so I need to loop through each item in the XML and output that data in its own list item.
PHP has a built in XML parser.
http://php.net/manual/en/book.xml.php
EDIT: This lib might work a bit easier if your structure is known ahead of time... http://www.php.net/manual/en/simplexml.examples-basic.php
Using that, as well as a CURL or standard
file_get_contents()call, you should be able to have the server retrieve the XML, parse it into a tree-structure, and iterate through the results to generate the HTML for display.