Video controls property
Example
Enable video controls:
document.getElementById("myVideo").controls=true;
Try it »
Definition and Usage
The controls property sets or returns whether the browser should display the standard video controls.
This property reflects
When this property is used, it specifies displaying the video controls.
The video controls include:
- Play
- Pause
- Progress bar
- Volume
- Fullscreen toggle (for video)
- Subtitles (when available)
- Tracks (when available)
Note:
Browser support





All major browsers support the controls property
Note: Internet Explorer 8 and earlier IE versions are not supported.
Syntax
Return the controls attribute:
videoObject
.controls
Set the controls attribute:
videoObject
.controls=true|false
Attribute values
| Value | Description |
|---|---|
| true|false | Describes whether to display the video controls:
|
Technical Details
| Return Value: | Boolean, returns true if the video controls are displayed, otherwise returns false. |
|---|---|
| Default value: | false |
More examples
Example
Check whether the video controls are displayed:
var x = document.getElementById("myVideo").controls;
x
The output is:
true
Try it »
Example
Enable, disable, and detect the control state:
var
x
=
document
.
getElementById
(
"
myVideo
"
)
;
function
enableControls
(
)
{
x
.
controls
=
true
;
x
.
load
(
)
;
}
function
disableControls
(
)
{
x
.
controls
=
false
;
x
.
load
(
)
;
}
function
checkControls
(
)
{
alert
(
x
.
controls
)
;
}
Try it »
Related pages
HTML Reference Manual: HTML
The Video object