
how to embed jw player with an xml mp3 playlist!!!
I spent most of the day today trying to figure out how to embed the jw player on my site, and have it load a playlist of mp3 files.
The secret magic trick - making the LOCATION of all the files I wanted to play IN THE PLAYLIST absolute links instead of location references on my domain.
For that matter, I would make EVERY location an absolute URL just to be on the safe side.
Here's an example of the embed and playlist.xml file code the way I got it working.
And by the way, the swfobject.js and player.swf files DO NOT have to be in the same folder location as the playlist.xml, or the mp3 files.
To create the embed code, I just used the setup wizard on this site with the example setup set to "bottom playlist from youtube" (since there IS NO OPTION FOR AN AUDIO PLAYLIST - RETARDED!), changed the "source" and "file" location to the absolute URLs on my site for the player.swf and playlist.xml, and changed the height to 200.
EXAMPLES:
<!-- //////////////////////EMBED CODE:\\\\\\\\\\\\\\\\\\\\\\\\\\ -->
<script type="text/javascript" src="http://MYSITEURL.com/FLVplayer/swfobject.js"></script>
<div id="player">This text will be replaced</div>
<script type="text/javascript">
var so = new SWFObject('http://MYSITEURL.com/FLVplayer/player-viral.swf','mpl','470','200','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=http://MYSITEURL.com/FOLDER/playlist.xml&playlist=bottom');
so.write('player');
</script>
<!-- //////////////////////playlist xml file code:\\\\\\\\\\\\\\\\\\\\\\\\\\ -->
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<title>Your MP3 Playlist</title>
<info>http://YourWebpageHere/</info>
<trackList>
<track>
<title>file1.mp3</title>
<location>http://MYSITEURL.com/FOLDER/file1.mp3</location>
</track>
<track>
<title>file2.mp3</title>
<location>http://MYSITEURL.com/FOLDER/file2.mp3</location>
</track>
</trackList>
</playlist>
For those of you who this helps, please post a thank you here, or email it to leveleyed [at] yahoo [dot] com.
~Mikebc.. <code><blockquote></blockquote>
</code>