HTMLMediaElement: volume property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The HTMLMediaElement.volume property sets the volume at which the media will be played.

Value

A number between 0 and 1, where 0 is effectively muted, and 1 is the loudest possible value.

Examples

js
const obj = document.createElement("audio");
console.log(obj.volume); // 1
obj.volume = 0.75;

Specifications

Specification
HTML
# dom-media-volume-dev

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
volume
Chrome – Full support
Chrome 3 (Release date: 2009-09-15)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 3.5 (Release date: 2009-06-30)
footnote Full support
Opera – Full support
Opera 12.1 (Release date: 2012-11-20)
footnote Full support
Safari – Full support
Safari 3.1 (Release date: 2008-03-18)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 12.1 (Release date: 2012-10-09)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 3 (Release date: 2009-06-17)
footnote Partial support
footnote volume returns a value and is writable; however, the value is always 1, and setting a value has no effect on the volume of the media object.
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 3 (Release date: 2009-06-17)
footnote Partial support
footnote volume returns a value and is writable; however, the value is always 1, and setting a value has no effect on the volume of the media object.

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support

See also