elegant themes

How to embed a .wmv file in WordPress

| November 7, 2011 | 10 Comments

A client recently asked us how they could embed .wmv files in their WordPress site so that it plays in a video player. Interestingly, we’re so used to working with video websites like YouTube and Vimeo which allow easy embedding by just pasting the URL into the editor that we’d never had to deal with this issue before. But after some trial by our awesome CEO Miriam Schwab and, well, really not much error, we quickly figured it out. So, without further ado, here is the way to embed .wmv files into WordPress posts and pages:

1. Install, activate and configure the TinyMCE Advanced plugin. This plugin allows you to add useful buttons to the WYSIWYG through a drag and drop settings page.

2. In the settings (Settings >TinyMCE Advanced), drag the “Insert Movie” button into the WYSIWYG:

3. Save changes.

4. Upload the video file of your choice to your WordPress site through Media > Add New.

5. Copy the URL of that video:

6. Open up the editor of the post/page where you’d like to embed the video (if you aren’t there already).

7. Click on the button which says “Insert/edit embedded media” when you hover over it:

You’ll get to this popup window:

5. Under “Type,” choose “Windows Media.”

6. Paste the URL in File/URL field.

7. Click “Insert.”

8. Save Draft or Publish.

9. Verify that it worked in the front end.

Note that the user’s browser has to have the Windows Media Player plug-in, and it needs to run to play the video in a player.

Here’s an example of an action-packed .wmv video:
The exciting news… By taking advantage of this function in WordPress, you could actually embed any video from around the web as long as you have the .wmv URL. Which might not be the nicest thing, but it’s possible.

Tags: , , ,

Category: Tips

About Deena Levenstein: View author profile.

Comments (10)

Trackback URL | Comments RSS Feed

  1. D London says:

    As Miriam pointed out – your server doesn’t have to handle the bandwidth of serving the video to viewers if you upload it to youtube.
    May seem unnecessary if you don’t have many visitors checking your site at the same time, but if you have a busy blog, where thousands of visitors come to read your new post, it may be a big problem. Couple years ago I had a fan site of a young singer who entered singing competition. Every time I posted new video – there were thousands of fans watching it, all at the same time, my server couldn’t handle it.
    Anyway, your post is very helpful, thank you.

  2. Sgt. Mac says:

    Been trying to install a small .wmv or flash video file from an Air Force sites. I followed the directions for the .wmv but cannot get the controls to show up to play it. I do have Windows Media. Any advice?
    It also comes with a flash video embed:
    <object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ id=”videoPlayer” codebase=”http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab” width=”538″ height=”404″><param name=”movie” value=”http://www.af.mil/shared/widgets/videoEmbedPlayer.swf ?http://www.af.mil/shared/xml/rssVideo.asp?mrsstype=3&contentid=81&contenttypeid=3&pos=0 ” /><param name=”quality” value=”high” /><param name=”bgcolor” value=”#ffffff” /><param name=”wmode” value=”transparent” /><param name=”allowScriptAccess” value=”always” /><param name=”allowFullScreen” value=”true” /><param name =”siteLink” value=”http://www.af.mil/news/video/index.asp?cid=1&sid=120″ /><param name=”flashVars” value=”url=?http://www.af.mil/shared/xml/rssVideo.asp?mrsstype=3&contentid=81&contenttypeid=3&pos=0” /><embed src=”http://www.af.mil/shared/widgets/videoEmbedPlayer.swf?http://www.af.mil/shared/xml/rssVideo.asp?mrsstype=3&contentid=81&contenttypeid=3&pos=0” bgcolor=”#ffffff” name=”videoPlayer” play=”true” loop=”false” quality=”high” allowscriptaccess=”always” flashvars=”url=?http://www.af.mil/shared/xml/rssVideo.asp?mrsstype=3&contentid=81&contenttypeid=3&pos=0” allowfullscreen=”true” siteLink=http://www.af.mil/news/video/index.asp?cid=1&sid=120 wmode=”transparent” type=”application/x-shockwave-flash” pluginspage=”http://www.adobe.com/go/getflashplayer” align=”middle” width=”538″ height=”404″ /></object>
    I’ve tried six or seven different WordPress plugins for flash, but can’t get anything to work…I think their code is too convoluted and I am not a techy by any means…Not sure I understand how the flash thing works.?
    Any advice?
    Thanks,  Sgt. Mac

    • Hey Sarge, if they provide Flash embed code, you don’t need the WMV player. You should be able to copy-paste the embed code into the editor, and the video will play. It’s possible that the WordPress editor is stripping out code, and that’s why it’s not working. You need to stop it from doing that. One way to do it is to add some code to your functions.php file – here’s how to do it: http://wpgarage.com/code-snippets/embedding-html-and-iframes-in-wordpress-2/.

      • Sgt. Mac says:

        My last effort late last night, was to paste the direct embed code into the post, and this time the video box and controls showed up, but the player won’t work. Am going to try your suggestion next and will post a follow-up. Thanks for the advice.

  3. Sgt. Mac says:

    I copied the code you suggested and opened up my functions.php file, but I have no idea, where to install the code?

  4. Sgt. Mac says:

    Don’t know if I am doing this right or not. I added the code to the functions.php file. I then went back to media and inserted the url that the video is on, not the flash code. It now gives me a direct text link to the video, not the player. I take it I did this wrong, but can’t figure it out, lol! I’ll leave it like this till I hear back from you. Thanks again for the help. ;)

  5. Sgt. Mac says:

    forgot…here is the code I added to the post:
    <a href=’http://www.af.mil/shared/widgets/popup.asp?url=http://www.af.mil/shared/xml/rssVideo.asp?mrsstype=3&contentid=81&contenttypeid=3&type=video&pos=0′>B1-B Lancer Video</a>

  6. jan says:

    Angry face hmm don’t know if i want that on my homepage :)

  7. James Todd says:

    Thank you very much for this valuable tutorial on using TinyMCE to embed a video. It worked flawlessly and easily for me. Tried about a dozen other methods which didn’t work for the locally produced video I was trying to embed.
    Two thumbs up

Leave a Reply

If you want a picture to show with your comment, go get a Gravatar.

More in Tips (18 of 96 articles)