The Wayback Machine - https://web.archive.org/web/20240717024550/https://www.geeksforgeeks.org/html-video-controls-attribute/
Open In App

HTML | <video> controls Attribute

Last Updated : 15 Jul, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The HTML <video> controls Attribute is used to specify the control to play video. It is the Boolean value. This attribute is new in HTML5. 

The video control should include:

  • Play
  • Pause
  • Volume
  • Full-screen Mode
  • Seeking
  • Captions/Subtitles(if available)
  • Track(if available)

Syntax:

<video controls>

Example: 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>HTML video controls Attribute</title>
</head>
 
<body>
    <center>
        <h1 style="color:green;">GeeksforGeeks</h1>
 
        <h3>HTML video controls Attribute</h3>
 
        <video width="400" height="200" controls>
            <source src=
                                type="video/mp4">
            <source src=
                                type="video/ogg">
        </video>
    </center>
</body>
 
</html>


Output:

  

Note: Always specify the width and the height of the video else web page will be confused that how much space that video will be required due to that reason web page become slow down.

Supported Browsers: The browser supported by HTML <video> controls Attribute are listed below:

  • Google Chrome 3.0 and above
  • Edge 12.0 and above
  • Internet Explorer 9.0 and above
  • Firefox 3.5 and above
  • Safari 3.1 and above
  • Opera 10.5 and above

Previous Article
Next Article

Similar Reads

HTML | DOM Video controls Property
The Video controls property is used to set or return whether a video should display standard video controls or not. The &lt;video&gt; controls attribute are reflected by this property. The video controls included in the property are: PlayPauseVolumeFullscreen ModeSeekingCaptions/SubtitlesTrack Syntax: Returning the controls property:videoObject.con
2 min read
HTML | &lt;audio&gt; controls Attribute
The HTML &lt;audio&gt; controls attribute is used to specify the control to play audio. It is the Boolean value. This attribute is new in HTML5. The audio control attribute contains the following property: PlayPauseSeekingVolume Syntax: &lt;audio controls&gt; Example: C/C++ Code &amp;lt;!DOCTYPE html&amp;gt; &amp;lt;html&amp;gt; &amp;lt;head&amp;gt
1 min read
HTML | controls Attribute
The HTML controls Attribute is used to specify that the audio and video controls must be displayed. It is a Boolean attribute and also new in HTML5. We can use this attribute in two tags &lt;audio&gt; and &lt;video&gt; The controls attribute includes the following properties on &lt;audio&gt; tag: Play Pause Seeking Volume The controls attribute inc
2 min read
What is the use the controls Attribute in HTML ?
The "charset" attribute in &lt;meta&gt; tags are used to specify the character encoding used by the HTML document. Character encoding determines how characters are represented and interpreted by the browser when rendering the web page. By explicitly defining the character encoding, developers ensure proper text display and avoid encoding-related is
1 min read
How to display video controls in HTML5 ?
The HTML &lt;video&gt; controls attribute is used to display video controls in HTML5. It is a Boolean attribute that adds video controls like volume, pause, and play. HTML5 commonly uses formats such as OGG, MP4, OGM, and OGV because browser support for these formats varies. Syntax &lt;video controls&gt; &lt;source src="video-file.mp4" type="video/
3 min read
HTML DOM Audio controls Property
The Audio controls property is used for setting or returning whether audio should display standard audio controls or not. The &lt;audio&gt; controls attribute is reflected by this property. The audio controls included in the property are: PlayPauseSeekingVolume Syntax: Return the control property:audioObject.controlsSet the control property:audioOb
1 min read
How to build custom form controls using HTML ?
There are cases when you want to perform advanced styling on some controls and feel like available native HTML form controls are not enough. In all such cases, you have to build your own controls. In this article, we will learn to create a custom control. Let us look at reconstructing the &lt;select&gt; element. It is good to start with an existing
3 min read
Troubleshooting HTML Form Controls: Resolving the 'Invalid Form Control' Error
HTML form is used to collect input from users, where form acts like a container for different types of input like text, number, or checkboxes. Form is an important part in web development, which allows users to input and submit data, making the application interactive. However, when working with forms you may see this error "Invalid form control".
3 min read
How to specify a list of pre-defined options for input controls in HTML?
Specify a list of pre-defined options for input controls by using the HTML list Attribute. A pre-defined option for input controls using HTML5's &lt;datalist&gt; element, allowing users to select from a predefined list while typing in an input field. Syntax: &lt;input list="datalist_id"/&gt;Example 1: The example below shows, the HTML form with an
2 min read
HTML &lt;video&gt; crossorigin Attribute
The HTML crossorigin attribute is used in the &lt;video&gt; element that supports a CORS request when we tried to fetch out the video files from the third-party servers or from another domain. Syntax: &lt;video crossorigin="anonymous | use-credentials"&gt; Attribute Values: anonymous: It has a default value. It defines a CORS request that will be s
1 min read
three90RightbarBannerImg