Hello guys welcome to the next video on html5 tutorial for beginners in this video we will see how we can add and use video element in HTML so to add a video element in HTML you need to use this element called video and this video takes the source of the video so just go between these video element and.
Add element called source ok and then you can provide the source of your video here.
So to add a source I have this video which I have made.
In the last video I’m going to just drag and drop into my web content folder and.
It will copy this into my web content folder so just leave this option copy files and click OK and.
It’s going to add this inside my web content folder same I’m going to do with a picture which I have so I have a PNG picture and I’m going to drag and drop into my web content folder this also this picture I’m going to use as a poster for the video in the later section but first of.
Add this source to our video element so to add this video to the source you just need to write the name of your video which is html5 dot mp4 and you can also add the type of.
Video you are adding so just add an attribute called type and in here just write video slash and.
Before so it’s a mp4 video ok now you can refresh your page and now you can see this video but it will not start automatically because we haven’t added any flag for starting right so let’s add a flag for automatically restarting this video so in your video element just.
Add an attribute called auto play and save your code and refresh it and now your video will start playing okay now you will.
Still not see the controls to stop or pause this video so to pause or to have more control for volume and maximizing and minimizing you can add an attribute called controls here so just add an attribute called controls and save your code and refresh.
The webpage and now you can see these controls here so you have this play and pause button you have this volume button you have this fullscreen button here right so this control attribute as the control to your video right now there is one more attribute which you can add here is Lu and what this does is it will provide the loop to your video so for example your video is finished here and then it will be replayed again and again until and unless you stops it.
Now there is one more attribute here which is called muted so when you add this attribute called muted and save your code and refresh it then your video will.
Be muted when it will be loaded so you can see it’s muted when it’s loaded right now suppose you want to give the size to your video so right.
Now it’s in its maximum size now you want to limit the size of your video what you can do here is you can add an attribute called width and you can give the width in pixels so you can.
And same you can do for height so just add this height attribute and you can give the amount of pixel you want okay save your code and refresh it and now your video will be.
Resized okay so let’s say it’s 600 by 300 okay so save your code and once again refresh it and it resizes your video okay now for example you want to give the banner or poster to your video so.