HTML Audio/Video DOM volume Property
Example
var vid = document.getElementById("myVideo");
function getVolume() {
alert(vid.volume);
}
function setVolume(x) {
vid.volume = x;
}
Meaning
The volume property sets or returns the volume of the audio/video.
Return a Number value, Specifies the current volume and the default value is 1.0.
Standard Syntax
Return the volume property:
audio|video.volume
Set the volume property:
audio|video.volume=number
Advertisement
Property Value
| Type | Description |
|---|---|
| number | Specifies the current volume of the audio/video.
Example values:
Note: Must be a number between 0.0 and 1.0. |