English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Manual de Referência HTML

Catálogo de etiquetas HTML

HTML Audio/Atributo muted do DOM de vídeo

muted indica se o elemento de mídia está mudo.

 HTML Audio/Video DOM Reference Manual

Exemplo Online

Desativar o som do vídeo:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Áudio HTML/Uso do atributo muted no vídeo-Tutorial Básico(oldtoolbag.com)</<title>
</<head>
<body>
<button onclick="habilitarMudo()" type="button">Mudo</botão>
<button onclick="desabilitarMudo()" type="button">Ligar efeitos sonoros</botão>
<button onclick="checkMute()" type="button">Verificar estado de mudo</botão>
<br> 
<video id="video1" controls="controls">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Seu navegador não suporta HTML5 etiqueta video.
</video>
<script>
myVid=document.getElementById("video1");
function habilitarMudo()
{ 
  myVid.muted=true;
} 
function disableMute()
{ 
  myVid.muted=false;
} 
function checkMute()
{ 
  alert(myVid.muted);
} 
</script> 
</body>
</html>
Test to see ‹/›

Definition and usage

Mute property setting or return whether the audio should be/Video mute (sound is turned off).

Browser compatibility

IEFirefoxOperaChromeSafari

All major browsers support the muted property.

Note:Internet Explorer 8 and earlier versions do not support this property.

Syntax

Set muted property:

audio|video.muted=true|false

Return muted property:

audio|video.muted

Attribute value

ValueDescription
trueIndicates that the audio should be closed/Video sound.
falseDefault. Indicates that the audio should be opened/Video sound.

Technical details

Return value:Boolean value, true|false
Default value:false
 HTML Audio/Video DOM Reference Manual