Control Volume With Extension

(Shoeb1137306174) #1

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
(Martin Giger) #2

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.

(rugk) #3

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…