Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to insert video in web page and play it using HTML ?

  • Last Updated : 14 Dec, 2020

HTML allows playing video in the web browser by using <video> tag. To embed the video in the webpage, we use src element for mentioning the file address and width and height attributes are used to define its size.

Example: In this example, we are using <video> tag to to add video into the web page. The video tag uses width, height, and control attributes to set the size and controls of video on web page. Also, use source tag with src attribute to add source of video.

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.




<!DOCTYPE html> 
<html
  
<body style="text-align: center;"
  
    <h1 style="color: green;">
        GeeksforGeeks
    </h1
      
    <h2
        How to insert video 
        and play in HTML
    </h2
  
    <p
        Adding Video on my Webpage 
    <p
      
    <video width="500px" height="500px" 
        controls="controls"/> 
          
        <source src="vid.mp4" 
            type="video/mp4"
    </video
</body
  
</html

Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!