Windows Media Player: How To Embed WMV File In HTML Code?
Thanks to many photo/video hosting sites available for free (but restricted to certain rules), e.g. Flickr and YouTube, everyone has an easier way to share their happiness captured in digital media files over the Net.
Some buddies, however, would like to share them entirely on their personal weblogs (thank to WordPress and Web 2.0 that have made it possible).
OK, embedding pictures in HTML and show the photos inline on a webpage is easy as usual. But, it needs more typing to embed video in HTML and stream the video content inline on a webpage.
Embedded image/video VS Inline image/video
In brief, “embedded image/video” present an URL or HTML link to the media file that might invoke a download process for the target file, a new browser window to display the media file, or invoke a third party program (non-browser application) to open the media file.
Then, “inline image/video” means web browser understand how to open and display the media file inside the same browser window, in line of the text surrounding it.
How to embed Windows Media Video/WMV file in HTML code and stream the video content inline on a webpage?
Windows Media Video/WMV file sample:
http://walkernewsdownload.googlepages.com/HP-iPaq-614.wmv
Embedded WMV file:
The code:
The result:
HP iPAQ Business Navigator
Inline WMV file:
The sample of code:
The result of the sample code:
Note: You might need to download and install Windows Media Player plugin/add-on to play inline Windows Media Player files.

OK, embedding pictures in HTML and show the photos inline on a webpage is easy as usual. But, it needs more typing to embed video in HTML and stream the video content inline on a webpage.
Embedded image/video VS Inline image/video
In brief, “embedded image/video” present an URL or HTML link to the media file that might invoke a download process for the target file, a new browser window to display the media file, or invoke a third party program (non-browser application) to open the media file.
Then, “inline image/video” means web browser understand how to open and display the media file inside the same browser window, in line of the text surrounding it.
How to embed Windows Media Video/WMV file in HTML code and stream the video content inline on a webpage?
Windows Media Video/WMV file sample:
http://walkernewsdownload.googlepages.com/HP-iPaq-614.wmv
Embedded WMV file:
The code:
<a href="http://walkernewsdownload.googlepages.com/HP-iPaq-614.wmv">HP iPAQ Business Navigator</a>
The result:
HP iPAQ Business Navigator
Inline WMV file:
The sample of code:
<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width="480" height="360" codebase="http://www.microsoft.com/Windows/MediaPlayer/"> <param name="Filename" value="http://walkernewsdownload.googlepages.com/HP-iPaq-614.wmv"> <param name="AutoStart" value="true"> <param name="ShowControls" value="true"> <param name="BufferingTime" value="2"> <param name="ShowStatusBar" value="true"> <param name="AutoSize" value="true"> <param name="InvokeURLs" value="false"> <embed src="http://walkernewsdownload.googlepages.com/HP-iPaq-614.wmv" type="application/x-mplayer2" autostart="1" enabled="1" showstatusbar="1" showdisplay="1" showcontrols="1" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0" width="480" height="360"></embed> </object>
The result of the sample code:
Note: You might need to download and install Windows Media Player plugin/add-on to play inline Windows Media Player files.
Custom Search






2010 •
[...] Windows Live Messenger is not showing or displaying title of song played in Windows Media Player, i.e. none of the MSN contacts can see what song you’re listening [...]
Hi ,
I have done “copy & Paste” this code on my sample page, but its worked only once, That was FLV player.
Media player is not play
Please update the code with another WMV file as the one in the code hosted in Google Pages will not be available after exceeding the granted bandwidth :-(
very useful tutorial~!
thank you.
I’ve tried several times to show my video, and it’s just not working. I’ve literally cut and paste your code, changed the file name to my wmv file, and nothing happens. What am i doing wrong? I should note, my wmv file is just a wmv file not wmv from a .com source. Does that matter?
I”ve been able to use your example and found it very useful. I’d like to make a picture appear in the player representing the video about to be played. Is this possilbe. Maybe a background or some other technique? Thanks in advance for any help.
hi, evrything is perfect and happened.
but the media file [which i have linked]having 30 minuts length is playing only 2.2 minuts and getting disconnected.
why it is not playing full length? is there any code to be added for the media files having morethan 5mb?
please help me.
regards
sundar
What about try to set the filename value and src of embed tag to a movie file in local hard disk, just to confirm it’s not network issue?
how can i insert my media file that is residing in my folder. the format of my media file is in .avi format. can you please help me on how can display my video without any distortion or limitation to other web browser… because when i use embed tag.. in firefox the video needed a plug in installations? and in google chrome, my videodoes not display. properly or not working properly.
If the web browser needs a plugin to work, it has to be installed.
I too, have been able to use your example and found it very useful. How can I make the first frame or the picture appear in the player representing the video about to be played. Maybe a background or some other technique?
Hi
Everything is working well– thanks –
BUT in Firefox the controls for the player do not show up.
Any thoughts?