Example 3

You need to upgrade your Flash Player

 

This example uses XML data to load multiple tracks into the player. The XML data is "built" using javascript.
The benefit of using XML data is that you can include additional information for each track such as artist, title, graphic and a link.

All data going into the player must be plain text. Do not put an XML object into the JavaScript function (e.g. XML-DOM) but rather use plain text "in the shape of" XML. Wimpy will parse the text into an XML object within Wimpy. Wimpy will not accept a "true" XML object.

There are a few different XML playlist formats that Wimpy will accept: Wimpy XML playlists, RSS / Podcast playlists and XSPF playlists. The example below is a Wimpy XML playlists.

 

Example Code*

<script language="JavaScript" >
   var myPlaylist = "";
   myPlaylist += "<playlist>";
   myPlaylist += "   <item>";
   myPlaylist += "     <filename>example1.flv</filename>";
   myPlaylist += "     <artist>Killeen and Gieson</artist>";
   myPlaylist += "     <title>Example 1</title>";
   myPlaylist += "     <comments>http://www.gieson.com/</comments>";
   myPlaylist += "     <image>example1.jpg</image>";
   myPlaylist += "   </item>";
   myPlaylist += "   <item>";
   myPlaylist += "     <filename>example2.flv</filename>";
   myPlaylist += "     <artist>Killeen and Gieson</artist>";
   myPlaylist += "     <title>Example 2</title>";
   myPlaylist += "     <comments>http://www.wimpyplayer.com/</comments>";
   myPlaylist += "     <image>example2.jpg</image>";
   myPlaylist += "   </item>";
   myPlaylist += "   <item>";
   myPlaylist += "     <filename>example3.flv</filename>";
   myPlaylist += "     <artist>Killeen and Gieson</artist>";
   myPlaylist += "     <title>Example 3</title>";
   myPlaylist += "     <comments>http://www.plaino.com/</comments>";
   myPlaylist += "     <image>example3.jpg</image>";
   myPlaylist += "   </item>";
   myPlaylist += "</playlist>";

   makeWimpyPlayer(myPlaylist);
</script>

 

 

 

* Be sure to review "Real World Usage"

 

 

©2007 Plaino