HTMLMediaElement.volume
La propriété HTMLMediaElement.volume
définit le volume auquel le média doit être lu.
Syntaxe
js
var volume = video.volume; //1
Valeur
Une valeur de type double (nombre à virgule) inclut entre 0 et 1, si elle vaut 0 le son est coupé et elle vaut 1 le son est le plus élevé possible.
Exemple
js
var obj = document.createElement("audio");
console.log(obj.volume); // 1
obj.volume = 0.75;
Spécifications
Specification |
---|
HTML # dom-media-volume-dev |
Compatibilité des navigateurs
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.
Voir aussi
- The interface defining it,
HTMLMediaElement
. HTMLMediaElement.muted