|
How to play multiple media files in embedded player
Hello all I have searched high and low to find this answer, and have been to many blogs. I have tested tons of code. Even after all efforts no luck. Well I have found the answer! I intend to go to all blogs and post it too. This question will baffle people no more!
Here goes...
After some searching and a lot of testing... Here's how I coded the embedded Media Player 9 to play more than one file in succession:
One of two files need to be created: either an ".asx" or a ".m3u" file. These files are
created through the Media Player itself.
First create a "playlist" of ".mp3" files that you want to play on the web page:
1. Choose "new playlist" in the media player tool bar
2. Name it, then begin selecting ".mp3" files or video files from the media library
3. Place these files in the "new playlist" you just created.
4. Once you have all the files you want in the playlist:
5. Select your playlist (highlight it)
6. Go to "file" in the media tool bar
7. Choose "save playlist as"
8. In the window that opens you will create your ".asx" or ".m3u" file
9. Name it
10. In the "save as type" box use the drop down menu to choose the file type
**You can choose either ".m3u", "any (.asx, .m3u, or .wpl)"
(I chose to use the .asx format because it just works easier. By choosing "any" it seems to only save your file in the ".wpl" format, which did not appear to be applicable to the embedded
player code according to all the information I could gather in my searches).
Now that you have created your ".asx" or ".m3u" file:
11. Upload this file and all ".mp3" files associated with it (what's in your playlist) to your server.
The code for the embedded player, using these playlist files is as follows:
<OBJECT ID="mediaPlayer"
CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="300" height="120"
CODEBASE="http://activex.microsoft.com/activex/
controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
STANDBY="Loading Microsoft Windows Media Player components..."
TYPE="application/x-oleobject">
<PARAM NAME="fileName" VALUE="http://myserver.com/New Playlist.m3u">
<PARAM NAME="animationatStart" VALUE="true">
<PARAM NAME="transparentatStart" VALUE="true">
<PARAM NAME="autoStart" VALUE="true">
<PARAM NAME="showControls" VALUE="true">
<PARAM NAME="ShowDisplay" VALUE="true">
<PARAM NAME="loop" VALUE="true">
</OBJECT>
Of course you'll need to adjust the width and height if you'll be using this to play videos; at the current settings listed above only the player controls and track info will be visible.
Well that's it friends. Feel free to embed, and play any media file associated with windows media player.
I hope this proves useful to people.
Pax vobiscum,
lucky4ever
|