Example 4
This example loads and opens an external playlist at startup.
As you can see, we've simply over-written the "wimpyApp" variable that was previously defined within rave.js. Since rave.js is loaded in the <head> of this HTML page all the variables are already established and we can change thier value as needed in the <body> portion of this page just before the player gets rendered.
NOTE: One might think to use the wimpy_loadExternalPlaylist or wimpy_appendPlaylist functions immediately after makeWimpyPlayer. Attempting to call these functions will not work because it takes a couple seconds for wimpy to initialize. It is best to use these functions as "user input" functions, where a user has to click on something in order for it to ocur.
The only other alternative would be to use the wimpy_amReady_ask function to check to see if Wimpy is ready to accept function calls. Once wimpy_amReady_ask returns "true" you can use any given function to communicate with Wimpy.
Source Code
<script language='javascript' src='rave.js'></script>
<div id="flashcontent">This DIV contents to be replaced by Rave.</div>
<script language="JavaScript" >
// Set the width and height of the player by over-writing the default config options:
defaultWimpyConfigs.wimpyWidth = "332";
defaultWimpyConfigs.wimpyHeight = "389";
defaultWimpyConfigs.wimpySkin = "skins/skin_js_examples.xml";
// Set the URL to the playlist file as "wimpyApp"
// When wimpyApp is defined, the contents of the playlist are opened and playable within the player.
// NOTE: You may notice that the other option "playlist" (e.g. defaultWimpyConfigs.playlist = "") is also available.
// Setting an XML FILE for playlist will only put the playlist file into the player, Rave will not open that.
defaultWimpyConfigs.wimpyApp = "playlist1.xml";
makeWimpyPlayer();
</script>
Part of the Wimpy Rave documentation.
©2009 Plaino