Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

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>

7 Community Answers

JW Player

User  
0 rated :


*_Supreme arrogance from a supremely retarded airhead._*

JW Player

User  
0 rated :

Hi Mike,
I've put your code in my web page but for some reason the actual screen for the video is not full height!
Blast!!!
The playlist comes in right but the screen is compress vertically.

Got any ideas why?

My page is here :
http://7times.org/studio/studio-old.shtml

If you have the time I would deeply appreciate any help you would care to give.

Thanks so much for even reading this message.

Ken

JW Player

User  
0 rated :

Hey, this code was super useful: especially the 'flashvars' parameter, which I would never have known to use.

JW Player

User  
0 rated :

"I've put your code in my web page but for some reason the actual screen for the video is not full height! "

notice the size parameters in the supplied embed code are 470 by 200.

the 200 parameter controls the height of the player.... if it is greater than 200 you will see video window... less than 200 starts to eliminate the showing of the player and the playlist.

the playlist and video player need to be at least 200 pixels high..... if your video is 640 by 480 then your size parameters should be 640 by 680 (add 200 to height to show the playlist and the full video screen).

JW Player

User  
0 rated :

add:

that comment about height of 200 applies only when NOT specifying a different playlist size than default, which is 180. So, playlist size is 180, player is 20... this is where 200 comes from. I am using a playlist i suggest people look here so see the different variables we can play with:

http://developer.longtailvideo.com/trac/wiki/FlashVars

JW Player

User  
0 rated :

Fantastic. Why is this the only place I could find this information easily and quickly, over a YEAR after it was first posted????

Thanks for the help, all working great.

JW Player

User  
0 rated :

Thank you Mike! You saved several hours of my life!!!

This question has received the maximum number of answers.