English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The controller attribute represents the media controller assigned to the element.
HTML Audio/Video DOM Reference Manual
Check if this video has a media controller:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML Audio/video controller attribute usage-Basic Tutorial(oldtoolbag.com)</title> </head> <body> <button onclick="checkMedCont()" type="button">Check if this video has a media controller: </button> <br> <video id="video1" controls="controls"> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support HTML5 video tag. </video> <script> myVid=document.getElementById("video1"); function checkMedCont() { alert("Controller: " + myVid.controller); } </script> </body> </html>Test and see ‹/›
The controller attribute returns audio/The current media controller of the video.
By default, audio/The video element does not have a media controller. If a media controller is specified, the controller attribute returns it as a MediaController object.
Hint: The control property can be used to set or return whether the standard video control should be displayed.
IEFirefoxOperaChromeSafari
The controller property is not supported by all mainstream browsers.
audio|video.controller
Type | Description |
---|---|
MediaController object | Represents audio/Media controller of the video. Properties of MediaController object/Method:
|