Created by Jeroen Wijering

« Back to The State of HTML5 Video

Volume API

This page lists JavaScript API support for getting and setting the value of the muted and volume attributes. It also tests if the volumechange event gets fired when one of the two attributes get updated, either through JavaScript or by using the built-in controls.

See the W3C video spec for more details on the media elements API.

Browser Get volume/muted Set volume/muted Volumechange event
Firefox for Desktop 25+ 25+ 25+
Chrome for Desktop 30+ 30+ 30+
Safari for Mac 6+ 6+ 6+
Internet Explorer for Windows 9+ 9+ 9+
Opera for Desktop 15+ 15+ 15+
Safari for iOS -1 -1 -1
Stock Browser for Android -2 -2 -2
Chrome for Android 36+ 36+ 36+
Internet Explorer for Winphone 8.0+ 8.0+ 8.0+
Firefox for Android 30+ 30+ 30+
  1. Muted always returning false, volume always returning 1.
  2. Getters, setters and event work, but the actual video volume does not change.

Test Tag

Here’s a video tag with some javascript operators:

  • Request the current muted or volume attributes.
  • Toggle the muted attribute or set the volume to 0.1 or 0.9.
  • Check below if changes to the muted or volume state are broadcasted: