How to Embed an MP4 Video in HTML

By Will Wright

An alternative to uploading your MP4 video to video-hosting websites is to embed it into your site with HTML. This gives you more control over how the video is displayed on your site and what other content is shown alongside. By embedding your MP4 (or MPEG-4) video in HTML, you can also retain your own branding, since video-hosting sites place their own logos on videos that they host.

Step 1

Place your cursor at the point in your HTML code where you want to embed the MP4 video.

Step 2

Insert the following code:

Step 3

Replace "videofilename.mp4" with the name of your MP4 video file. Remember to add ".mp4" after the filename. If your MP4 video is in a different folder from the one that contains the HTML file, enter the proper file path.

Step 4

Change all HEIGHT and WIDTH attributes in pixels, as needed. Change the AUTOPLAY attribute to "false" if you don't want the video to start automatically playing as soon as the webpage loads.