Video volume property
Example
Set the video volume to 20%:
document.getElementById("myVideo").volume = 0.2;
Try it »
Definition and Usage
The volume property sets or returns the current volume of the video, from 0.0 (muted) to 1.0 (maximum).
Note:
Browser support





All major browsers support the volume attribute.
Note: Internet Explorer 8 and earlier IE versions do not support
Syntax
Return the volume attribute:
videoObject
.volume
Set the volume attribute:
videoObject
.volume=
number
Attribute values
| Value | Description |
|---|---|
| number | Specifies the current volume of the video. Must be a number between 0.0 and 1.0. |
实例 :
Technical Details
| Return Value: | A number representing the volume of the video |
|---|---|
| Default value: | 1.0 |
The Video object