Web/API/HTMLMediaElement/volumechange event

From Get docs


The volumechange event is fired when the volume has changed.

Bubbles No
Cancelable No
Interface Event
Target Element
Default Action None
Event handler property GlobalEventHandlers.onvolumechange
Specification HTML5 media

Examples

These examples add an event listener for the HTMLMediaElement's volumechange event, then post a message when that event handler has reacted to the event firing.

Using addEventListener():

const video = document.querySelector('video');

video.addEventListener('volumechange', (event) => {
  console.log('The volume changed.');
});

Using the onvolumechange event handler property:

const video = document.querySelector('video');

video.onvolumechange = (event) => {
  console.log('The volume changed.');
};

Specifications

Specification Status
HTML Living StandardThe definition of 'volumechange media event' in that specification. Living Standard
HTML5The definition of 'volumechange media event' in that specification. Recommendation

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
volumechange event Chrome

Full support Yes

Edge

Full support 12

Firefox

Full support Yes

IE

Full support 9

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support Yes

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

Legend

Full support  
Full support


Related Events

See also