Latest web development tutorials

HTML DOM Video volume properties

Video Object Reference Video Object

Examples

The video volume set to 20%:

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

try it"

Definition and Usage

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

Note: <video> element in HTML5 is new.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support volume attributes.

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


grammar

Returns volume attributes:

videoObject .volume

Setting volume attributes:

videoObject .volume = number

Property Value

value description
number The provisions of the current volume of the video. It must be a number between 0.0 and 1.0.
Example:
  • 1.0 is the highest volume (default)
  • 0.5 is half the volume (50%)
  • 0.0 Mute

technical details

return value: Number that is the volume of the video
Defaults: 1.0


Video Object Reference Video Object