Audio controllerProperties

Audio 对象参考手册Audio Object

Examples

Detect whether the audio has a media controller:

var x = document.getElementById("myAudio").controller;

Try it Yourself »

Definition and Usage

The controller property returns the current media controller of the audio/video.

By default, audio/video elements do not have a media controller. If a media controller is specified, the controller property returns it in the form of a MediaController.

Tip:UsecontrolsThe property sets or returns whether the audio displays controls (such as play/pause, etc.).


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Currently, no mainstream browsers support the controller property.


Syntax

audioObject.controller

Return Value

Value Description
MediaController Object

Represents the media controller of the audio/video.

MediaController Object Properties/Methods:

  • buffered - Gets the buffered range of the audio/video
  • seekable - Gets the seekable range of the audio/video
  • duration - Gets the duration of the audio/video
  • currentTime - Gets or sets the current playback position of the audio/video
  • paused - Detects whether the audio/video is paused
  • play() - Plays the audio/video
  • pause() - Pauses the audio/video
  • played - Detects whether the audio/video has been played
  • defaultPlaybackRate - Gets or sets the default playback rate of the audio/video
  • playbackRate - Gets or sets the current playback rate of the audio/video
  • volume - Gets or sets the volume of the audio/video
  • muted - Gets or sets whether the audio/video is muted


Audio 对象参考手册Audio Object Other Extensions