How to Embed a Video into a Webpage

First select the video you wish to embed into your web sight.

Option A:

To imbed a video from a directory, use the <video> tag with the <source> tag. Like used in an image, to allow the browser to know what video to use, the "src" atribute. Then, the type of video file must be stated. For a file named "crash-course.mp4," the code would appear as below.

<video>

<source src="crash-course.mp4" type="video/mpeg">

<video>

Option B:

1) To embed a video into a web page from an external video hosting service like YouTube or Vimeo, find the share and embed feature on your video.

2) As you can see, the iframe tag is used. Keep in mind that when usin iframe, the video and source tags are not needed.

3) On YouTube, make sure that you check the first three of four checkboxes for these requirements.

4) Then put your code into your web page.

Here is what your final video will look like.

Back to Home