HTML Audio/Video DOM controller attribute

Example

Check if the video has a media controller:

myVid=document.getElementById("video1");
alert("Controller: ", myVid.controller);

Try it yourself

Definition and Usage

The controller attribute returns the current media controller of the audio and video.

By default, audio and video elements do not have a media controller. If a media controller is specified, the controller attribute will return it in the form of MediaController.

Browser Support

The controller attribute is not supported by any mainstream browser.

Syntax

audio|video.controller

Return Value

Value Description
MediaController Object

Represents the media controller for the audio/video.

MediaController Object Properties/Methods:

  • buffered - Get the buffering range of the audio/video
  • seekable - Or the addressable range of the audio/video
  • duration - Get the duration of the audio/video
  • currentTime - Get or set the current playback position of the audio/video
  • paused - Detect whether the audio/video has been paused
  • play() - Play the audio/video
  • pause() - Pause the audio/video
  • played - Detect whether the audio/video has been played
  • defaultPlaybackRate - Get or set the default playback rate of the audio/video
  • playbackRate - Get or set the current playback rate of the audio/video
  • volume - Get or set the volume of the audio/video
  • muted - Get or set whether the audio/video is muted