View Full Version : Help with Embedding Windows Media Player

12-23-2007, 10:16 PM
Is there any way that I can embed a Windows Media Player that:
1. A player that automatically starts.
2. It can play more then one song.
3. It automatically shuffles, so each time I visit the site, the song should be different.


12-24-2007, 05:28 AM
Just try it..
first installing
To get started, you must first include the core JavaScript code, in the <head> of your HTML page, either as embedded music JavaScript or link to the "wimpy.js" file using a scr method. The download package contains examples of how to do this. "example_1.html" uses an embedded music <script> approach, wheras "example_2.html" links to the "wimpy.js" as an external JavaScript file (the scr method).

Once you have the core JavaScript included in your HTML, you can now reference the JavaScript function and render a player anywhere in your page.

To render a player make a call to t he function, "makeWimpyPlayer" contains 4 options:

- The width of the player in pixels

- The height of the player in pixels

- The hex value of background color, set to FALSE for transparent background.

- A "pipe" delimited list of URLs to MP3 files.


Example 1
This implimentation would render a player at 300x100 pixels in dimension using a background color of white and display one file in the playlist named "file" :

makeWimpyPlayer(300, 100, "FFFFFF", "http://www/path/to/file.mp3);

Example 2
This example would render a player at 125x20 pixels, using a "see through" (i.e. transparent player which would reveil the HTML background color or image "through" the player) and would display two files in the playlist. the first file in the playlist would be named "file 1" and the second would be named "file 2"

makeWimpyPlayer(125, 20, FALSE,

NOTE: the above example code was plit into two lines to make it easier to read... when implimenting your JavaScript code, you function call should all be on one line.

Example 3

In this example, we are using a much larger playlist. Raather than try and put each playlist item one | after | another (which can get confusing, we can utilize a JavaScript array, and list out each item in it's own line.

// Establisgh an array:
a = Array();
// add items to the array:
a[a.length] = "http://www/path/to/file_1.mp3";
a[a.length] = "http://www/path/to/file_2.mp3";
a[a.length] = "http://www/path/to/file_3.mp3";
a[a.length] = "http://www/path/to/file_4.mp3";
// Glue each element ofthe array together with a pipe:
myPlaylist = a.join("|");
// Render the player:
makeWimpyPlayer("200", "300", "333333", myPlaylist);


Ehen installing the core JavaScript code, you have the options of customizing the player's behavour. Use to the following as a guide to eaach optioin. This information can also be found in the "readme.txt" file included in the download package.

URl to where you have wimpy.swf uploaded to your server.
wimpySwf = "http://www/path/to/wimpy.swf";

URL to skin_name.xml file
wimpySkin = "http://www.yoursite.com/path/to/skin_wimpy_vert.xml";

URL to config file. if this is used, the config file will
over-ride the options set below.
wimpyConfigFile = "http://www.yoursite.com/path/to/wimpyConfigs.xml";

URL to script that receives information about the file
trackPlays = "http://www.yoursite.com/path/to/wimpy_trackplays.php";
Leave as empty string if not using.
trackPlays = "";

URL to script that receives information about the file
voteScript = "http://www.yoursite.com/path/to/wimpy_vote_script.php";
Leave as empty string if not using.
voteScript = "";

URL to default iamge (jpg or swf format only)
voteScript = "http://www.yoursite.com/path/to/graphic.jpg";
Leave as empty string if not using.
defaultImage = "";

This should be pretty easy to understand.
Options: "yes" or "no"
startPlayingOnload = "no";

This should be pretty easy to understand.
Options: "yes" or "no"
shuffleOnLoad = "no";

This should be pretty easy to understand.
Options: "yes" or "no"
randomOnLoad = "no";

This should be pretty easy to understand. Download links will open files in a new window.
Options: "yes" or "no"
displayDownloadButton = "no";

This will cause wimpy to start on a specific track in the playlist.
The number used will be the track number Wimpy will start to play
when Wimpy loads up. Using this option will over-ride "startPlayingOnload"
-- if startPlayingOnload is set to "no" and this option is set, then Wimpy
will automatically set startPlayingOnload to "yes"
startOnTrack = "3";
Leave as empty string if not using.
startOnTrack = "";

Force the user to click "next" to advance to the next track,
or automatically advance )keep on playing tracks)
Options: "yes" or "no"
autoAdvance = "yes";

This should be pretty easy to understand.
Options: "yes" or "no"
popUpHelp = "yes";

This should be pretty easy to understand.
Options: "yes" or "no"
scrollInfoDisplay = "yes";

This will set the speed of the scroller.
Higher values will increase the scroll speed.
infoDisplayTime = "3";

This will cause the player to "wait" the specified period of time
(in seconds) before the track actually starts to play. This option
is good for slow internet connections, since it allows the file to
load X number of seconds before it starts to play -- thereby minimizing
a "choppy" playback. If the end user has a fast connection, the track
may not hesitate for the total number of seconds used for this option
and may start to play much sooner.

Options: Number of seconds to "wait" before playing track. (For slow connections only)
bufferAudio = "3";

This will set the "default" volume percentage when the player starts up.
Options: Any number from 0 to 100 (think "percent")
theVolume = "100";

If you are using a skin that displays cover art, wimpy will automatically attempt
to load an image that has the same name as your audio.mp3 file. For example,
if you have a file located here:
Then wimpy will attempt to load:
Set this to the type of file it should load.
Options: "swf" or "jpg"
defaultVisualExt = "jpg";

try this...

12-24-2007, 11:49 AM
a flash player can do the same like this one: http://www.*******************/?item=JW_MP3_Player if you are interested tell me then i could help you to set it up.