English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
muted indica se o elemento de mídia está mudo.
HTML Audio/Video DOM Reference Manual
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 ‹/›
Mute property setting or return whether the audio should be/Video mute (sound is turned off).
IEFirefoxOperaChromeSafari
All major browsers support the muted property.
Note:Internet Explorer 8 and earlier versions do not support this property.
Set muted property:
audio|video.muted=true|false
Return muted property:
audio|video.muted
Value | Description |
---|---|
true | Indicates that the audio should be closed/Video sound. |
false | Default. Indicates that the audio should be opened/Video sound. |
Return value: | Boolean value, true|false |
---|---|
Default value: | false |