Jake Ludington's MediaBlab
Subscribe Subscribe

Feedback


Windows Movie Maker HelpDo you shoot videos with a camera or camcorder?
Quickly learn techniques to make amazing videos without purchasing expensive software. This printable home-study guide shows you how to make better-looking movies from your AVCHD, HDV, or portable camcorder. Download Mastering Movie Maker now! Coupon code: APRILBABY saves you 35%.

Embedding Windows Media Player WMA

It's definitely smart to make your audio offerings available for subscription via RSS and direct download via a Website link. Enabling audio playback from the familiar audio playback experience of the Windows Media Player play controls helps get some listeners past the hurdle of figuring out how to tune in. If your audio file is a WMA or MP3 file, there are a few simple steps to linking your audio to Windows Media Player controls imbedded in the browser.

When you offer a direct download, users click on a link to the audio file and either view the video in their desktop Windows Media Player or save it to their hard drive. To stream your audio file with visible Windows Media Player controls, you need to embed the player in the page where you post your audio file. This requires some specific HTML code included in the page or blog post where the audio is linked.

There are some potential headaches to this method, including support for browsers like Firefox and Safari. Mac users don't have Windows Media Player installed by default and Safari issues a nasty warning message with no link to the resolution on Macs without Windows Media Player. Internet Explorer handles embedded Windows Media files nicely, which is to be expected since it's also a Microsoft product. For broad compatibility with all browsers, it's best to stick with the version 6.4 embedded player (which has nothing to do with the version of desktop player the user might have installed).

There are certain things every embedded Windows Media Player needs to function properly, along with a long list of optional parameters. Each embedded player instance on your Web page needs the object definition to clarify which version of the Windows Media Player will be called. This is identified by both the CLSID reference and the CODEBASE definition. For the 6.4 version of the embedded player this looks like the example below:

<object id="MediaPlayer" height=46 classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">

The one required parameter is the location of your audio file, which is defined using the "filename" parameter:

<param name="filename" value="http://yourdomain/youraudio.mp3">

Some optional parameters include showing the Windows Media Player controls and whether the audio starts automatically. Since you are using the Showcontrols parameter, keep in mind your player height should be 46 pixels to accommodate the height of the files. The height parameter isn't required, but leaving it out causes the player to resize as it's loading, creating an ugly experience for your listener.

<param name="Showcontrols" value="True">
<param name="autoStart" value="True">

The final part of the implementation is the embed statement which includes the application you are embedding and a link to your video file like this:

<embed type="application/x-mplayer2" src=" http://yourdomain.com/youraudio.mp3" name="MediaPlayer" width=320 height=240></embed>

The finished code looks like the example below, which you can copy for your own site and simply replace the links to your audio file where appropriate and adjust the necessary height settings.

<object id="MediaPlayer" height=46 classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">

<param name="filename" value="http://yourdomain.com/youraudio.mp3">
<param name="Showcontrols" value="True">
<param name="autoStart" value="True">

<embed type="application/x-mplayer2" src=" http://yourdomain.com/youraudio.mp3" name="MediaPlayer"></embed>

</object>

Be sure to close the whole thing with that ending </obeject> tag.

Here's an example of the code in action:

For more advanced streaming needs, consider using a Windows Streaming Server to manage your audio files, which allows you to offer files capable of detecting the users connection speed for an optimized experience and include things like advertising when appropriate.



Featured Resources

How to choose the right Identity Protection service.
Read our comparison of identity protection options to help you pick the best one for your family.

Master Home Movie Editing
Read a detailed guide on how to improve your home movies.

Instantly Fix Driver Problems
Find missing drivers on your XP or Vista PC.

Back up your iPod
iPod Access backs up your iPod music library and transfer songs to a new computer.

Convert Vinyl to MP3 or CD
Convert your Vinyl LPs and Cassettes to CD or MP3 using a simple software solution.

Multimedia Help
Camcorder Answers
AVCHD Help
Digital Video
HDTV
Media Center PC
Movie Maker Help
Photography
Podcasting

Productivity
Gadgets
Gmail Tips
Office Help
Outlook Tips
PowerPoint
VoIP
Web Services

Mac, iPod, iPhone
Mac Help

Social Media
Facebook Help
MySpace Tips
YouTube Tips

Video Games
PSP Hacks
PSP and iPod Movies
Xbox 360

Comparison Shopping
Memory Cards
Digital Cameras
Digital Video Cameras
MP3 Players
DVD Players
HD Television
Pocket PC
GPS Devices
Cell Phones