November 29th, 2006
How to embed a .wmv file in a webpage
Ever wanted to have a .wmv file play automatically when a user visits your website? This is how you'd do it. 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.
Here's the code to embed a Windows Media File into an HTML page:
<object id="MediaPlayer" width=320 height=286 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/yourmovie.wmv">
<param name="Showcontrols" value="True">
<param name="autoStart" value="True">
<embed type="application/x-mplayer2" src="http://media.pmcmovies.com/SixtiesLove.wmv" name="MediaPlayer" width=320 height=240></embed>
</object>


on October 5th, 2007 at 10:45 am
Thanks for the code. I've been looking for a lot of them, and yours is the only one that works. Unfortunately, my Internet Explorer keeps popping up the information bar asking me if I'm sure I want to see the active content. I followed the instructions in the help to turn it off, but it still keeps popping up! (I have XP) Too annoying to use.
But thanks anyway. Your code works great.
May
on October 17th, 2007 at 11:21 am
agreed! yours is the only code I've found that works.
Thanks!
on October 31st, 2007 at 10:26 am
thank you for the code!
this is the best code that i have found on the net and which is very understandable. thanks again
on December 17th, 2007 at 2:21 pm
Excellent Code – works with no problems. Thanks for this.
on March 8th, 2008 at 5:02 pm
wow! This really works! I was getting very frustrated until I found this code! Great!
on April 29th, 2008 at 2:55 pm
How do you avoid the black startup screen? I'd like the player to feature a still photo from my video…to entice viewers.
on June 25th, 2008 at 4:43 pm
yes, it would be nice not to have the black startup screen, anybody?
on July 10th, 2008 at 10:07 am
When I saw the date of original post, I was afraid that the information would be outdated. To my surprise, it works great!!! Thanks, and I'll keep watching for updates as we evolve to newer coding routines.
on July 16th, 2008 at 4:53 am
thanks a lot!! I was experimenting with others embed/object that I found in the net but this is the best example, and it works with firefox/opera
on September 3rd, 2008 at 4:12 pm
I have a JavaScript down menu on my page which now appears behind my video, any suggestions on how to move it to the front
on September 25th, 2008 at 3:02 pm
Did anyone ever figure out how to get a screen shot instead of the black screen? I think it worked perfected except for this one little thing.
Thank you foy rour help.
Michelle
on November 5th, 2008 at 6:10 pm
Exactly what I needed… thank you very much!
on November 19th, 2008 at 3:43 pm
try this to avoid Active X content, that pops up
.
on December 3rd, 2008 at 4:05 pm
Nice post and appreciate the info. I inserted it into my blog and got only a black screen to come up. When I click on play, nothing happens. But, when I put in the full URL to the VID and click, it works fine. Any idea of what I'm doing wrong? The page I'm referencing is http://www.forshizelmynizel.com/a-kilt-a-sausage-and-some-buns.html
THANKS AGAIN! Really do appreciate people like you helping rook's like us
on February 1st, 2009 at 6:23 pm
Thanks! It works well with Firefox but for some reason Internet Explorer doesn't play the file. It shows the player but doesn't play. The 'play' button doesn't even offer the option to start.
Anyone with any ideas? Thanks!
-Matt
on March 3rd, 2009 at 12:42 pm
to allow drop menus to appear in front of the video, you need to change the window mode to transparent.
In the object tag, add:
In the embed tad, add:
wmode="transparent"
on March 3rd, 2009 at 12:46 pm
I think the object param was striped from my reply
param name="wmode" value="transparent"
on March 6th, 2009 at 3:18 pm
Thank you for your help. I was trying to use Dreamweaver to embed the audio file but could not get it to find the plug-in. Your code works perfectly.
on March 31st, 2009 at 2:05 pm
Thanks. I placed this code on tripractix.com/testimonial, but it will not work with Safari or Firefox. Any thoughts?
on April 8th, 2009 at 2:38 pm
Hi ..it's works fine in my internet explorer..but doesn't work in firefox..anyidea..thanks for the work…
on April 25th, 2009 at 12:31 am
I agree. Your code works and the others don't. Not in Firefox or Safari to be sure but in IE. Thanks.
on May 1st, 2009 at 7:34 pm
Hi all,
For what it's worth I, like Matt above, got this code to work in Firefox but not IE. I used the similar but slightly different code at this site and it worked on both. This may just be due to some other error on my part though, so YMMV.
on May 5th, 2009 at 10:43 am
I've had this code on my website for a couple years working fine. For the last couple months it stopped delivering the video to the users browsers. Has microsoft changed something?
on July 20th, 2009 at 1:05 pm
This code only seems to work with IE. Any thoughts?
on July 30th, 2009 at 12:20 am
[...] Good link for embedding video [...]
on February 16th, 2010 at 4:05 pm
Great code. It works perfectly. Thanks for taking the time to put this information together. I really appreciate it.
Jen
on February 20th, 2010 at 10:27 am
thanks for help
on February 25th, 2010 at 9:07 pm
Still works!