Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Audio controller Property

Audio controller Property

Audio Object Reference Audio object

Example

Detect whether the audio has a media controller:

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

Try it »


Definition and Usage

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

By default, audio/video elements have no media controller. If a media controller is specified, the controller property returns it as a MediaController.

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


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Currently no major browser supports 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 - get the buffered range of the audio/video
  • seekable - get the seekable 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 - check whether the audio/video is paused
  • play() - play the audio/video
  • pause() - pause the audio/video
  • played - check 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
  • |

    Audio Object Reference Audio object