How to add Video in HTML page
To add a video in HTML, you can use the HTML5 video tag and specify the video source file. Here's an example:
<video width="640" height="360" controls>
<source src="example.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
In this example, the video tag creates a video player on the page. The width and height attributes specify the dimensions of the player in pixels. The controls attribute adds basic playback controls such as play, pause, and volume.
The source element specifies the location and file type of the video file using the src attribute and the type attribute. In this case, we're using an MP4 file, but you can also use other file types like WebM or Ogg.
Finally, the text "Your browser does not support the video tag." is displayed if the browser does not support the video tag.
How to add youtube video in html page
To add a YouTube video to an HTML page, you can use an iframe element and embed the video using the YouTube embed code. Here's an example:
<iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID" frameborder="0" allowfullscreen></iframe>
In this example, replace VIDEO_ID with the ID of the YouTube video you want to embed. You can find the ID in the URL of the video, after the "v=" parameter.
The iframe element creates a window for the video to play in. The width and height attributes specify the dimensions of the window in pixels.
The src attribute specifies the source of the video, which is the YouTube embed code with the VIDEO_ID parameter.
The frameborder attribute specifies whether or not the frame should have a border. Setting it to 0 removes the border.
The allowfullscreen attribute specifies whether or not the video should be allowed to play in fullscreen mode.
Note that you need to have an internet connection for the YouTube video to play. You can also customize the appearance and behavior of the video player using CSS and JavaScript.