HTML DOM Video controls property
Definition and Usage
controls property sets or returns the browser should display a standard video controls.
This property reflects the <video> controls property.
When using this attribute, which specifies the display video controls.
Video control contains:
- Broadcast
- time out
- progress bar
- volume
- Full-screen toggle (for video)
- Subtitles (when available)
- Track (when available)
Note: <video> element in HTML5 is new.
Browser Support
All major browsers support attribute controls
Note: Internet Explorer 8 and earlier versions of IE do not support the <video> element.
grammar
Returns controls properties:
videoObject .controls
Setting controls properties:
videoObject .controls = true | false
Property Value
value | description |
---|---|
true | false | It describes whether to display video controls:
|
technical details
return value: | A Boolean value that, if the video display control returns true, otherwise returns false. |
---|---|
Defaults: | false |
More examples
Examples
See if the video controls show:
var x = document.getElementById ( "myVideo") controls.;
x The output is: true
try it"
Examples
Enable, disable, and test 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);
}
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 <Video> Controls property
Video Object