How to add YouTube Video using HTML, Javascript, PHP

Adding YouTube video using HTML

To add videos to your web page you will have to change there format because different browsers support different formats. Instead of this, you have an easier solution, just add YouTube videos link to your webpage.

Adding YouTube video using HTML

We need to do the following steps.

  1. Upload video to YouTube.
  2. Copy the embed code of the video.
  3. Make a <iframe>.
  4. Paste the embed code in the src attribute.

Adding YouTube video using PHP

Let’s see the code of “Adding YouTube video using PHP”.

Adding YouTube video using JavaScript

Let’s see the code of “Adding YouTube video using JavaScript”.

How embedded Video Looks in a Web page?

Here, there is a demo that how a video looks on a web page.