HTMLMediaElement: volume Eigenschaft
Die HTMLMediaElement.volume
-Eigenschaft legt die Lautstärke fest, mit der das Medium abgespielt wird.
Wert
Ein Double-Wert muss zwischen 0 und 1 liegen, wobei 0 effektiv stummgeschaltet ist und 1 der lautestmögliche Wert ist.
Beispiele
js
const obj = document.createElement("audio");
console.log(obj.volume); // 1
obj.volume = 0.75;
Spezifikationen
Specification |
---|
HTML # dom-media-volume-dev |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
volume |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Siehe auch
HTMLMediaElement
: Schnittstelle zur Definition derHTMLMediaElement.volume
-EigenschaftHTMLMediaElement.muted