Video volumeProperty

Video 对象参考手册Video Object

Example

Set the video volume to 20%:

document.getElementById("myVideo").volume = 0.2;

Try it Yourself »

Definition and Usage

The volume property sets or returns the current volume of the video, from 0.0 (mute) to 1.0 (loudest).

Note:The <video> element is new in HTML5.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the volume property.

Note:Internet Explorer 8 and earlier IE versions do not support the <video> element.


Syntax

Return the volume property:

videoObject.volume

Set the volume property:

videoObject.volume=number

Property Values

Value Description
number Specifies the current volume of the video. Must be a number between 0.0 and 1.0.
Example:
  • 1.0 is the loudest volume (default)
  • 0.5 is half volume (50%)
  • 0.0 is mute

Technical Details

Return Value: A number representing the volume of the video
Default Value: 1.0


Video 对象参考手册Video Object Other Extensions