How To Embed WMV (Windows Media Video) File to Playback with WMP Player on Web Page

Windows Media Video (WMV) format is a popular video codec format developed by Microsoft, which supports Internet streaming applications, WMV Screen and WMV Image, and is now mandatory video codec for HD DVD and Blu-ray Disc (BD-ROM), plus PlaysForSure-certified online stores and devices. WMV is also the only supported video codec for the Microsoft Silverlight platform.

In Windows operating system, a WMV coded video media file can be easily created with Windows Movie Maker, preinstalled in Windows Vista and available for free download via Windows Live Suite for Windows 7. It’s also possible to encode a video in WMV format with Windows Media Encoder or many other video editing application software that supports WMV.

It’s possible to upload a Windows Media Video WMV video file to video sharing or video hosting sites such as Youtube, Metacafe, DailyMotion, Facebook, MySpace and more. However, some webmasters or bloggers may want to host the video directly from own web server and web pages on self-hosted website, without using embed code from video sharing service which may restrict the size, resolution, length and other criteria of the streaming video.

To embed a WMV video inline on a web page (HTML, blog, PHP, ASP or other scripting language supported), and allow visitor to stream playbak and watch video content inline on site, use the following guide to build the embed code for WMV video that is displayed inline on the website and can be viewed directly from the website without leaving the web page, with automatic playback support. Embedding a WMV on web page also disable it from been served as target to be direct downloaded, nor invoke a media player to play the file after downloading.

WMV (Windows Media Video) Inline Embed and Stream Code

<object id="MediaPlayer" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width="480" height="360" 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://www.domainname.tld/filaname.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">
<param name="AnimationatStart" value="1">
<param name="TransparentatStart" value="1">
<param name="Loop" value="0">

<embed type="application/x-mplayer2" src="http://www.domainname.tld/filaname.wmv" name="MediaPlayer" autostart="1" showstatusbar="1" showdisplay="1" showcontrols="1" loop="0" videoborder3d="0" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="480" height="360"></embed>
</object>

Each embedded WMV player on web page is defined by <object> declaration to clarify which version of Windows Media Player to call, which identified by CLSID reference and CodeBase definition. Example above uses Windows Media Player embedded player version 6.4.

“FileName” parameter is required to specify the location of the movie file.

Other parameters are optional parameters that defines how the embedded WMP player should behaves or displays, such as control whether the movie should start playing automatically as soon as it’s buffered (AutoStart), whether to display information such as file name (ShowDisplay), buffering time (BufferingTime) and more. All explanation on the embedded Windows Media Player supported properties can be read here.

Tip: If the embedded player has Control Bar (ShowControls is True), the player height has to be at least 46 pixels bigger than movie resolution so that the playback doesn’t get squeezed. Similarly, status bar (ShowStatusBar is True), which shows buffering progress and playback status of the clip requires 26 pixels of height. For example, a video with 360 of height needs to have a height reference of 406 or 386 pixels to display accurately.

Tip: If you want embeeded player to auto resize itself according to movie size, remove the width and height definition from the embed code.

The embed implementation is required which also specifies a link to the WMV video file, and application embedding. All HTML tags have to be closed properly. Below is an exampled of embedded WMV video player.


2 Responses to “How To Embed WMV (Windows Media Video) File to Playback with WMP Player on Web Page”

  1. Carlos
    October 11th, 2009 11:24
    2

    Gracias me sirvio mucho

  2. Roma
    September 18th, 2009 04:30
    1

    How can you avoid empty black screen at the beginning? In FLV (Flash) you can tell application to show a particular frame from the movie. Is it possible with WMV? Is it possible to insert a picture there with some tag?

    Thanks!

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.
Custom Search

New Articles

Incoming Search Terms for the Article

embed wmv - embed wmv in html - html embed wmv - embed windows media player - embed wmv video - embed .wmv - windows media player embed - embed wmv in web page - windows media embed code - embed wmv on website - embed a wmv in a web page - embed windows media video - embed wmv html - how to embed wmv - embedded wmv - embed wmv web page - embed wma - html wmv - windows media movie empty black screen - html show time in embedd media wmv with oparameter - fichiers wmv sur windows 7 - Inline WMV file - embed wmv parameters - embed a wmv - embed wmv - embedding wmv in html - how to embed wmv video - Embedding WIndows Media Player - embed wmv on web page - embed streaming wmv - windows media video file - y - windows media audio/video file - wmv embed code - embedded wmv code - embedding wmv - how do we play a wmv video file xp windows - embed wmv file in web page - embed wmv player - embed wmv in web page firefox - html inline wmv video - embed wmv movi in html and add photo at beginning - starting frame on wmv playback - embed windows media player 11 example - how to embed a windows media player - microsoft embed windows media player wmv - windows movie maker vidio embed free html code - embedded wmv video size problem - standby screen for wmp embedded - windows media player imbed -