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;

Try it yourself

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:

  • 1.0 is the maximum volume (100%, default)
  • 0.5 is half volume (50%)
  • 0.0 is silent (the same as mute)

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