Here is the code to embed video in html or WordPress post

Here is the simple iFrame code to embed any video on an HTML page or WordPress post/page, just what you need is the URL of the video you want to embed.

Most of the times we embed videos from Youtube or platforms like it, where we can easily get the embed code, however, what about videos without embed code. I mean if you only have URL of some particular video available online and want to display on your website’s HTML or WordPress page. Thus, we are here with this post, in which we not only provide you with the <iFrame> element code but also let you know how to control the height and width of the embedded video.

Here is the code: 

<iframe width="560" height="315" src="https://videolink" frameborder="0" allowfullscreen>
</iframe>

The above code is the same which you find while copying embedded code of any video from Youtube. Now to use it on WordPress Post.

Just go to your post or page and click on the Text section.

Embed video on WordPress post or page using iframe code 2

Paste the above-given code and replace the https://videolink with the Video link which you want to show on your page or post.

In the same way, open the HTML page where you want to embed video and copy-paste the above link with the replacement of video link.

Change the height and width of the video.

To resize the embed video window as per your need, we just have to increase or decrease two values given in the iFrame code, that are:

  • width=”560″
  • height=”315″

Change the values of the elements in the above given to get the appropriate size of the video.

If you are learning HTML coding then here is simple code to embed and show your video from the internet or local machine.

<!DOCTYPE html>
<html>
<head>
<title>My project</title>
</head>
<body>
<p>Code to embed videos</p>
<br />
<iframe width="560" height="315" src="https://replace-this-video-link" frameborder="0" allowfullscreen></iframe>
</body>
</html>

So, this is a simple method to display any videos from different sources on website pages. Here is one more important tutorial which surely helps you in future: How to embed google drive video without iframe in WordPress or blog.