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)


(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.