Control Volume With Extension

I Am making An extension for people with hearing problem…
and i want to control the volume of audio and video playing . any documentation on volume api for extension(add-on)

1 Like

The way you control the volume of things is to use a content script and find the audio/video elements and then modify their volume.

See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts and https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/volume

There are also related properties on Tabs: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/Tab specifically audible and muted.

BTW (totally theoretically and maybe not advisable) you could also require a native part for your add-on installed on the system that you can communicate from your add-on with. This way, you could even adjust the system volume…