English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
muted indica si el elemento de medios está silenciado.
Audio HTML/Manual de referencia del DOM de video
Deshabilitar el sonido del video:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Audio HTML/Uso del atributo muted de video-Tutoriales básicos(oldtoolbag.com)</<title> </<head> <body> <button onclick="habilitarSilencio()" type="button">Silenciar</botón> <button onclick="activarSonido()" type="button">Iniciar sonido</botón> <button onclick="comprobarSilencio()" type="button">Revisar estado de silencio</botón> <br> <video id="video1" controls="controls"> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Su navegador no admite HTML5 etiqueta video. </video> <script> myVid=document.getElementById("video1"); function habilitarSilencio() { myVid.muted=true; } function disableMute() { myVid.muted=false; } function checkMute() { alert(myVid.muted); } </script> </body> </html>Prueba y mira ‹/›
Configuración o devolución de la propiedad de silenciar el audio/Video silenciado (el sonido está apagado).
IEFirefoxOperaChromeSafari
Todos los navegadores principales admiten el atributo muted.
Nota:Internet Explorer 8 y versiones anteriores no admiten este atributo.
Establece el atributo muted:
audio|video.muted=true|false
Devuelve el atributo muted:
audio|video.muted
Valor | Descripción |
---|---|
true | Indica que se debe cerrar el audio/El sonido del video. |
false | Predeterminado. Indica que se debe abrir el audio/El sonido del video. |
Valor devuelto: | Valor booleano, true|false |
---|---|
Valor predeterminado: | false |