Hi guys, I am Shahzad and welcome in lecture number 12. Today we are going to discuss about you YouTube, the external video which you want to embed in your HTML or in your project. So how can you do that the most easiest way to embed any video by using the iframe, I can see they have had you have the basic knowledge of HTML. And I'm going to comment this bad boy so you can easily get the code. Okay, now we know very well that if you open the youtube youtube so as you can see, this is the YouTube and sexy. This is our channel.
Okay, now, hello Udemy. I am Shahzad from something this html5 I've just uploaded this HTML file. So YouTube, as you can see, this is the ID. And when you upload any video on YouTube, YouTube automatically generate a particular ID. So you need this ID to embed your video in your HTML file. Okay.
Now, how can you do that? Make sure I'm using the iframe. And now I'm saying iframe close. Everything's the width of width of the iframes. I'm saying 400. Sorry, 400.
And now I'm saying Hi. I'm saying 300 versus 400. By 300. We can hide. Now I'm saying if I said the source, okay. I'm saying HTTPS Everywhere.
Www.youtube.com slash embed slash your ID here which ID this this is if you embed this ID here so you can see I should be as www youtube.com okay now you are ready to go now go to the page refresh the page as you can see now you are just going to play this button hi guys I am Shahzad and welcome election number first. So as you can see, it's now working fine. You can also use your keyboard can also handle your width and height from here. So as you can see, this is the width and this is the height 300 by 200. Okay, fine. If I'm saying that 300 by 300 it's also fine.
It should depend upon you and your requirement. Okay. If you want to hide the control. So how can you do that? Go to the court, use the question mouse, and now add the controls equals to zero. Go to the page, refresh the page.
Now as you can see, the control is zero. You can just play the Hi guys, I am Shahzad, but you don't have the play and something like this. You can also embed the other video like from the daily motions from the Y mule. So if you are here and click on the share button, and as you can see, this is the embed, click on the embed. So they gives you the iframe. So copy this iframe and also paste this iframe in your code.
So now you can see this is the code and I'm going to come into this one so you can easily get the code Okay, now go to the video. The page is fine. You have just embedded the video Hi guys I am Shahzad and will from the YouTube. Okay, so it's shortly depend upon you. So I think this is enough for today. In the next section we are going to cover some other topics from the html5.
Thanks for watching