How to embed video in a web page

This article explains how to embed video in a web page. If you are using a content management system (CMS) such as WordPress or Joomla, or a WYSIWYG HTML editor, the steps will be different and can be found in the application’s documentation.

There are two methods you can use to embed video. Which method you use depends on the format of the video. To embed WMV files, use the Windows Media Player method. To embed MP4 files, use the Quicktime method.

Before you begin

Before you begin editing your HTML file, upload the video file to your website. You can place the file in the root directory of your website, usually public_html, or in a subdirectory.

Editing HTML files

There are two methods you can use to edit HTML files:

  • If the file already exists on your website, you can download it using an FTP client and then edit it using your preferred text editor. If you are creating a new file, create the file in your text editor. When you’ve made the changes in the file, save and upload it. For more information, see Downloading and using FTP software programs.
  • You can also add or edit the file in the cPanel File Manager. For more information, see How to navigate in cPanel’s File Manager.

Embedding video using Windows Media Player

To embed WMV video in your web page, open the HTML file and add the following lines of code. Replace mydomain.com with your own domain and sample.wmv with the path and file name of your own WMV file.

<object id="MediaPlayer" width=320 height=286 classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player ..." type="application/x-oleobject" codebase="https://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"> 
<param name="filename" value="https://mydomain.com/sample.wmv">
<param name="Showcontrols" value="True">
<param name="autoStart" value="True">
<param name="wmode" value="transparent">
<embed type="application/x-mplayer2" src=https://mydomain.com/sample.wmv" name="MediaPlayer" autoStart="True" wmode="transparent" width="320" height="286" ></embed>
</object>

Note that embedded WMV files are not supported in some web browsers. Internet Explorer is the best option for viewing embedded WMV files.

Embedding video using Quicktime

To embed MP4 or MOV videos using the Apple Quicktime player, open the HTML file and add the following lines of code. Replace mydomain.com with your domain and sample.mp4 with the path and file name of your MP4 or MOV file.

<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="https://www.apple.com/qtactivex/qtplugin.cab" height="256" width="320">

<param name="src" value="https://www.mydomain.com/sample.mp4">
<param name="autoplay" value="false">
<param name="target" value="myself">
<param name="controller" value="false">
<param name="href" value="https://www.mydomain.com/sample.mp4">
<param name="type" value="video/quicktime" height="256" width="320">

<embed src="https://www.1st-host.com/sample.mp4" height="256" width="320" autoplay="false" type="video/quicktime" pluginspage="https://www.apple.com/quicktime/download/" controller="false" href="https://www.mydomain.com/sample.mp4" target="myself"></embed>
</object>

More information

If you need help with your HostPapa account, please open a support ticket from your dashboard.

Related Articles

Get online with our affordable web hosting

Get online with our affordable web hosting

Learn more now
HostPapa Mustache