English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
muted bedeutet, ob das Medienelement stummgeschaltet ist.
HTML Audio/Video DOM Reference Manual
Schalten Sie das Video-Lautstärke aus:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML Audio/Video muted Eigenschaft verwenden-Grund教程(oldtoolbag.com)</<title> </<head> <body> <button onclick="enableMute()" type="button">Stummschaltung</button> <button onclick="disableMute()" type="button">Aktivieren Sie den Ton</button> <button onclick="checkMute()" type="button">Überprüfen Sie den Lautstärkezustand</button> <br> <video id="video1" controls="controls"> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Ihr Browser unterstützt keine HTML5 video Tag. </video> <script> myVid=document.getElementById("video1"); function enableMute() { myVid.muted=true; } function disableMute() { myVid.muted=false; } function checkMute() { alert(myVid.muted); } </script> </body> </html>Test to see ‹/›
Mute attribute setting or return whether the audio should be/Video muted (sound is off).
IEFirefoxOperaChromeSafari
All major browsers support the muted attribute.
Note:Internet Explorer 8 and earlier versions do not support this attribute.
Set the muted attribute:
audio|video.muted=true|false
Return the muted attribute:
audio|video.muted
Value | Description |
---|---|
true | Indicates that the audio should be muted/The sound of the video. |
false | Default. Indicates that the audio should be played/The sound of the video. |
Return value: | Boolean value, true|false |
---|---|
Default value: | false |