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

HTML Referenzhandbuch

HTML Tag大全

HTML Audio/Video DOM muted Eigenschaft

muted bedeutet, ob das Medienelement stummgeschaltet ist.

 HTML Audio/Video DOM Reference Manual

Online-Beispiel

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 ‹/›

Definition and Usage

Mute attribute setting or return whether the audio should be/Video muted (sound is off).

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the muted attribute.

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

Syntax

Set the muted attribute:

audio|video.muted=true|false

Return the muted attribute:

audio|video.muted

Attribute value

ValueDescription
trueIndicates that the audio should be muted/The sound of the video.
falseDefault. Indicates that the audio should be played/The sound of the video.

Technical Details

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