Example 3

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.

This DIV contents to be replaced by Rave.

 

 

Source Code

<script language='javascript' src='rave.js'></script>
<div id="flashcontent">This DIV contents to be replaced by Rave.</div>

<script language="JavaScript" >

// Create XML playlist.
// NOTE: See "rave_js_example_javascript_playlists.js" for alternate methods for generating an XML playlist using an array container.


var myPlaylist = "";
myPlaylist += "<playlist>";
myPlaylist += " <item>";
myPlaylist += " <filename>example1.flv</filename>";
myPlaylist += " <artist>Killeen and Gieson</artist>";
myPlaylist += " <title>Example 1</title>";
myPlaylist += " <link>http://www.gieson.com/</link>";
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 += " <link>http://www.wimpyplayer.com/</link>";
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 += " <link>http://www.plaino.com/</link>";
myPlaylist += " <image>example3.jpg</image>";
myPlaylist += " </item>";
myPlaylist += "</playlist>";


// Set the width and height of the player by over-writing the default config options:
defaultWimpyConfigs.wimpyWidth = "332";
defaultWimpyConfigs.wimpyHeight = "389";


// Set the skin:
defaultWimpyConfigs.wimpySkin = "skins/skin_js_examples.xml";

// Render the player

makeWimpyPlayer(myPlaylist);

</script>

 

 

 

 

 

Part of the Wimpy Rave documentation.
©2009 Plaino