Example 5

This example shows how you can load items into Wimpy and control the player through standard HTML

This DIV contents to be replaced by Rave.

Clear Playlist
Add One Track
Add Multiple Tracks
Clear Playlist
Load and open external playlist

Clear Playlist
Add One Track (and play immediately)
Pause
Play
Stop

Clear Playlist
Add Multiple Tracks
Go to and play the second track in the playlist
Next
Previous

Source Code

The following lines are traditionally written in the <head> of the page. NOTE: Although it is not required that these lines appear between the opening <head> and closing </head>, they may also appear in the <body>, however, if these lines do appear in the <body> they must be written above any code that executes any function contained in the external file.

<!-- NOTE: We've externalized the playlist data for the "Add Multiple Tracks" links. -->
<script language='javascript' src='rave_js_example_javascript_playlists.js'></script>
<script language='javascript' src='rave.js'></script>

The following goes into the <body>

<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";
defaultWimpyConfigs.wimpyApp = "playlist1.xml";


// Render the player
makeWimpyPlayer();


</script>

The following lines are used to interact with the player:

<a href="javascript:;" onClick="wimpy_clearPlaylist();">
Clear Playlist
</a>

<a href="javascript:;" onClick="wimpy_appendPlaylist(addFilesA, false)">
Add One Track
</a>

<a href="javascript:;" onClick="wimpy_appendPlaylist(addFilesC, false)">
Add Multiple Tracks
</a>

<a href="javascript:;" onClick="wimpy_clearPlaylist();">
Clear Playlist
</a>

<a href="javascript:;" onClick="wimpy_loadExternalPlaylist('playlist.xml')">
Load and open external playlist
</a>

<a href="javascript:;" onClick="wimpy_clearPlaylist();">
Clear Playlist
</a>

<a href="javascript:;" onClick="wimpy_appendPlaylist(addFilesB, true)">
Add One Track (and play immediately)
</a>

<a href="javascript:;" onClick="wimpy_pause()">
Pause
</a>

<a href="javascript:;" onClick="wimpy_play()">
Play
</a>

<a href="javascript:;" onClick="wimpy_stop()">
Stop
</a>

<a href="javascript:;" onClick="wimpy_clearPlaylist()">
Clear Playlist
</a>

<a href="javascript:;" onClick="wimpy_appendPlaylist(addFilesC, false)">
Add Multiple Tracks
</a>

<a href="javascript:;" onClick="wimpy_gotoTrack(2)">
Go to and play the second track in the playlist
</a>

<a href="javascript:;" onClick="wimpy_next()">
Next
</a>

<a href="javascript:;" onClick="wimpy_prev()">
Previous
</a>

 

 

 

Part of the Wimpy Rave documentation.
©2009 Plaino