Easy Tutorial
❮ Prop Form Target Prop Canvas Shadowoffsety ❯

controller Attribute

Audio Object

Example

Check if the audio has a media controller:


Definition and Usage

The controller attribute returns the current media controller of the audio or 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 a MediaController.

Tip: Use the controls attribute to set or return whether the audio displays controls (such as play/pause, etc.).


Browser Support

Currently, no major browsers support the controller attribute.


Syntax

Return Value

Value Description
MediaController Object Represents the media controller of the audio or video. MediaController object properties/methods: buffered - Get the buffered ranges of the audio or video<br> seekable - Get the seekable ranges of the audio or video<br> duration - Get the duration of the audio or video<br> currentTime - Get or set the current playback position of the audio or video<br> paused - Check if the audio or video is paused<br> play() - Play the audio or video<br> pause() - Pause the audio or video<br> played - Check if the audio or video has been played<br> defaultPlaybackRate - Get or set the default playback rate of the audio or video<br> playbackRate - Get or set the current playback rate of the audio or video<br> volume - Get or set the volume of the audio or video<br> muted - Get or set whether the audio or video is muted

❮ Prop Form Target Prop Canvas Shadowoffsety ❯