Audio defaultMutedProperty

Audio 对象参考手册Audio Object

Example

Set the audio to be muted by default:

document.getElementById("myAudio").defaultMuted = true;

Try it Yourself »

Definition and Usage

The defaultMuted property sets or returns whether the audio is muted by default.

Setting this property only changes the default muted state, not the current one. To change the current muted state, use themutedproperty.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Only Google Chrome and Safari 6 browsers support the defaultMuted property.


Syntax

Return the defaultMuted property:

audioObject.defaultMuted

Set the defaultMuted property:

audioObject.defaultMuted=true|false

Property Value

Value Description
true|false Specifies whether the audio is muted by default.
  • true - Specifies that the audio is muted by default.
  • false - Default. Specifies that the audio is not muted by default.

Technical Details

Return Value: A Boolean value, returns true if the audio is set to be muted by default, otherwise returns false.
Default Value: false


Audio 对象参考手册Audio Object Other Extensions