Video volume attribute
Definition and usage
volume
The volume attribute sets or returns the volume of the video, ranging from 0.0 (mute) to 1.0 (full volume).
Example
Set the video volume to 20%:
document.getElementById("myVideo").volume = 0.2;
Syntax
Return the volume attribute:
videoObject.volume
Set the volume attribute:
videoObject.volume = number
Attribute Value
Value | Description |
---|---|
number |
Specifies the volume of the video. It must be a number between 0.0 and 1.0. Example Value:
|
Technical Details
Return Value: | A number representing the volume of the video. |
---|---|
Default Value: | 1.0 |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 9.0 | Support | Support | Support |