Audio controller properties

Definition and usage

controller The property returns the current media control of the audio.

By default, the <audio> element does not have a media control. If a media control is specified, the controller property will return it as a MediaController object.

Tip:Please use controls property Set or return whether the audio should display the standard video control.

Instance

Find out if the audio has a media control:

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

Try it yourself

Syntax

audioObject.controller

Return value

Type Description
MediaController object

Represents the media control for the audio.

MediaController object properties/methods:

  • buffered - Get the buffered range of the audio
  • seekable - Get the seekable range of the audio
  • duration - Get the duration of the audio
  • currentTime - Get or set the current playback position of the audio
  • paused - Check if the audio is paused
  • play() - Play the audio
  • pause() - Pause the audio
  • played - Controlla se l'audio è stato riprodotto
  • defaultPlaybackRate - Ottieni o imposta la velocità di riproduzione predefinita dell'audio
  • playbackRate - Ottieni o imposta la velocità di riproduzione corrente dell'audio
  • volume - Ottieni o imposta il volume dell'audio
  • muted - Ottieni o imposta se l'audio è silenziato

Supporto browser

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Non supportato Non supportato Non supportato Non supportato Non supportato