...

View Full Version : Help with Embedding Windows Media Player



doomsdaydave11
12-23-2007, 09: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.

Thanks.

easynet
12-24-2007, 04: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:

theWidth
- The width of the player in pixels

theHeight
- The height of the player in pixels

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

thePlaylist
- 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" :

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

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"

<script>
makeWimpyPlayer(125, 20, FALSE,
"http://www/path/to/file_1.mp3|http://www/path/to/file_2.mp3");
</script>

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.

<script>
// 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);
</script>

---
Configuration

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.

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

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

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

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

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

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

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

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

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

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

startOnTrack
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"
Example:
startOnTrack = "3";
Leave as empty string if not using.
Example:
startOnTrack = "";

autoAdvance
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";

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

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

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

bufferAudio
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";

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

defaultVisualExt
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:
http://www.yoursite.com/mp3s/track1.mp3
Then wimpy will attempt to load:
http://www.yoursite.com/mp3s/track1.jpg
Set this to the type of file it should load.
Options: "swf" or "jpg"
defaultVisualExt = "jpg";

try this...

sybil6
12-24-2007, 10: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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum