How to Embed a Video With Media Player
If you would like to attract more visitors to your website, adding entertaining videos to the site can help. Adding movies or videos to your site will make it more fun and interactive and will give visitors a reason to hang around.
Because the majority of Web surfers use the Microsoft Windows operating system, many people have the Windows Media Player installed on their PCs. You can enter some basic HTML code into a Web page, allowing you to embed the player into the page and stream videos that you upload to your site.
Things You'll Need
- Web server
- Web page editor (Notepad, Dreamweaver or another HTML editing application)
- Video file
Instructions
-
-
1
Create a new HTML Web page file with the editor application or browse to a folder on your hard drive that already contains the HTML file you want to edit. Alternatively, download the HTML file from your website.
-
2
Launch the HTML editor application and open the HTML file. Use the keyboard or mouse to scroll down to the line of HTML code where you want to embed the video file and Windows Media Player.
-
-
3
Enter or Copy and paste the following lines of HTML code into the editor:
<OBJECT ID="MediaPlayer" WIDTH="360" HEIGHT="240" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="VideoFileName.wmv">
<PARAM name="autostart" VALUE="false">
<PARAM name="ShowControls" VALUE="true">
<param name="ShowStatusBar" value="false">
<PARAM name="ShowDisplay" VALUE="false">
<EMBED TYPE="application/x-mplayer2" SRC=" VideoFileName.wmv" NAME="MediaPlayer"
WIDTH="192" HEIGHT="190" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED>
</OBJECT>
-
4
Enter the actual video file name in place of the "VideoFileName.wmv" reference in the code. Be sure to include the ".wmv" extension in the file name.
-
5
If you want the video to play as soon as the Web page loads in the surfer's browser, change the "autostart="0"" to "autostart="1.""
-
6
Save the edited HTML file and close the editor application.
-
7
Upload the HTML file to your website using the File Manager utility included with your Web hosting account or with an FTP program. Upload the video file in the same directory as the HTML Web page file.
-
8
Direct your Web browser to the HTML page on the website. Windows Media Player loads automatically and begins playing the video file if you enabled the auto-start option. If not, press the "Play" button on the media player to view the video.
-
1
Tips & Warnings
You can also use this same method to stream audio or music files. Just change the file name in the "VideoFileName.wmv" code reference and upload the MP3 or WMA music file into the same directory as the Web page.
References
- Media College: How to Embed Windows Media Files
- University of California, San Francisco: Embedded Media HTML Generator
- MioPlanet: How to Embed Windows Media Player in HTML Document
- Microsoft Developer's Network: Using the Windows Media Player Control in a Web Page
- Microsoft Windows Media: Introduction to Windows Media Metafiles
- Photo Credit Video Cassette image by Guitar75 from Fotolia.com