To find out, what can be done using the remote control functionality of the WebPlayer, just have a look at In the left bottom corner of the page you can find a simple example of a WebPlayer remote control. While the player is running, you are able to control the WebPlayer completely just by using the control buttons.

Technically those buttons use the WebPlayer JavaScript library (libvanadium.js) to control the WebPlayer. To use this library you have to download our latest WebPlayer release and include the JavaScript library into your webpage.

After including the library your webpage should look something like:



<title>Try our music</title>
<script language='javascript' type='text/javascript' src='./libvanadium.js'></script>
<object id="myPlayer" data="webplayer.swf" type="application/x-shockwave-flash" width="240" height="64">
<param name="movie" value="webplayer.swf">
<param name="menu" value="false">
<param name="scale" value="noscale">
<param name="bgcolor" value="#C0C0C0">
<param name="flashvars" value=


Note: The id of the flash movie is myPlayer. This is important to tell JavaScript which player has to be controlled.

Well now you have a running WebPlayer on your webpage. To remote control it you have to create an instance of a javascript class called Vanadium. To tell javascript which player you want to control (you probably have multiple on your page) you have to bind the instance to the flash movie by using the id myPlayer. The following line show how easy that is:

//Create WebPlayer javascript instance
var myWebPlayer = new org.webminster.Vanadium();
//Bind instance to flash movie which has the id "myPlayer"
//Control the player as you like;

The documentation of the WebPlayer JavaScript API extensively describe the whole API.

Another very useful feature of the WebPlayer library is the write() function. It enables you to insert a WebPlayer flash movie in your webpage by just calling a javascript function. By the way our testpage uses exact this functionality when you press the "Go" Button.

Similar to the above example you have to create an instance by calling var myWebPlayer = new org.webminster.Vanadium(...). To change the default properties of the player you can parameterize the call. To insert the WebPlayer now just call myWebPlayer.write("playerDiv"). In this case the WebPlayer will be inserted into the HTML tag which has the id "playerDiv".

By the way, the insertion is done using the SWFObject library. It guarantees that the WebPlayer flash movie is always included within your homepage appropriate to your visitors browser.

The following example shows, how to insert the WebPlayer using javascript:

//Create WebPlayer javascript instance
var myWebPlayer = new org.webminster.Vanadium("webplayer.swf", "playlist.xspf", 280, 64, true, true, false);
//Bind instance to flash movie which has the id "myPlayer"
//Insert WebPlayer into webpage as child of HTML element having id "playerDiv"