English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Directory

HTML Audio/Video DOM controller attribute

The controller attribute represents the media controller assigned to the element.

 HTML Audio/Video DOM Reference Manual

Online Example

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 ‹/›

Definition and Usage

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.

Browser Compatibility

IEFirefoxOperaChromeSafari

The controller property is not supported by all mainstream browsers.

Syntax

audio|video.controller

Return value

TypeDescription
MediaController objectRepresents audio/Media controller of the video.

Properties of MediaController object/Method:

  • buffered - Get audio/Buffering range of the video

  • seekable - Get audio/Seekable range of the video

  • duration - Get audio/Duration of the video

  • currentTime - Get or set audio/Current playback position of the video

  • paused - Detect audio/Is the video paused?

  • play() - Play audio/Video

  • pause() - Pause audio/Video

  • played - Detect audio/Has the video been played?

  • defaultPlaybackRate - Get or set audio/Default playback rate of the video

  • playbackRate - Get or set audio/Current playback rate of the video

  • volume - Get or set audio/Volume of the video

  • muted - Get or set audio/Is the video muted?

 HTML Audio/Video DOM Reference Manual