There are 4 .js files available with all the SP commands. You can either link your pages to these .js or copy/paste the functions you need where you want them. It is recommended that you link your pages to the .js hosted by Cedelia on streamplug.com since they are kept updated and new functions come with new releases of the player.
The scripts can be downloaded there :
SP Installation Scripts
- The browser detection and installation scripts
- Playback commands (play - pause - etc.)
SP Playlist Scripts
- Playlists scripts
SP Appearance Scripts
- Display scripts (skin, buffer color, background color)
Linking To The .js Files
page where you want SP to appear :
This method presents the advantage of sparing you to copy the entire functions where you need them, using the following syntax instead :
Where SP-SCRIPT is replaced with the specific function you want to use and value by the value you have to indicate if any.
Copying Each Function Separately
If you do not want to link your pages to the .js, the other solution is to copy the entire function you need directly in your pages. We took here the installation script as an example. The same goes for all the other functions. The syntax will then be something like this :
This is the Installation Script found in StreamPlug.js :
document.write("<EMBED type=application/x-OGM name=StreamPlugNs width=",w," height=",h," >")
else if(navigator.appName=="Microsoft Internet Explorer")
document.write("<OBJECT ID=StreamPlugIe WIDTH=",w," HEIGHT=",h," codebase='http://streamplug.com/StreamPlug/SP.cab' CLASSID='CLSID:2019DC25-D1C0-11D6-97B3-0008A124F542'><PARAM NAME=width VALUE=0></OBJECT>");
document.write("<p>Browser Not Supported</p>");
If you choose this method , you have to put this code
anywhere in your code for SP to be installed or for the commands to work.
Copying Versus Linking
Copying functions directly in your page will override the scripts linked in the .js files. Copying the functions directly can allow more flexibility, as shown above, since some values are defined by default in the .js scripts. This is particularly true of the installation. Most of the other scripts do not need be copied inside the pages, links towards the .js hosted on streamplug.com are sufficient and more simple to use.