0

I caught myself wanting to make a cross-tab sound controller and i have done some research on this, but i can't really find a good way to go about controlling the sound for all elements in all open tabs.

Does anyone know of any way with jq, js, or anything else that can run in a browser that can be used to controll the volume of all open (and new) tabs?

The use-case would eks be muting all tabs with one button, adjusting up or down the total "browser volume" in one place, and such.

I haven't been able to find any support for this so far, so does that mean it really is impossible after all?

Edit: The main thing is that this needs to be "cross-tab" and not just a way to adjust a single audio player / audio source playing in a single tab. Say you have 5 tabs with Youtube open and i want to be able to mute / lower volume / raise volume of all those tabs from one single tab.

Reaver
  • 313
  • 2
  • 19
  • Volume of what exactly? Obviously you can't change the computer volume, this would be a monumentally bad idea. But you [can control the volume of embed resources](https://stackoverflow.com/questions/10075909/how-to-set-the-loudness-of-html5-audio). A "tab" doesn't have a volume.... – Liam Jun 12 '17 at 12:22
  • @Liam Yeah, i realize being able to control the system volume from js would be a horrendous idea (which is why that's not possible). What i'm thinking of is maybe a way to control the volume of all the active sound sources in the open browser across all the tabs. And the main thing here is that it needs to be cross-tab and not just for 1 and 1 tab. – Reaver Jun 12 '17 at 12:24
  • Possible duplicate of [How to set the loudness of HTML5 audio?](https://stackoverflow.com/questions/10075909/how-to-set-the-loudness-of-html5-audio) – Liam Jun 12 '17 at 12:26
  • You can only control volume on your page (single tab). Letting your control the volume of items on someone else web page in a different browser session would be a security risk – Liam Jun 12 '17 at 12:27
  • That's more or less what i thought, but i figured there might be a way i was unable to discover that would make this problem solvable which is why i wanted to ask. But i once again completely understand why it's not possible. – Reaver Jun 12 '17 at 12:31

2 Answers2

0

It depends what you mean by "In the browser". I think that you will only really be able to accomplish this as a browser plug-in or extension. That may not be what you're looking for, but browser extensions can implement that functionality. See: https://developer.chrome.com/extensions/samples and look at the chrome sounds sample. That might give you a good place to start.

Rafael Kennedy
  • 858
  • 5
  • 16
0

I did find a solution for lowering the volume on one given tab. You could simply repeat it for each tab.

Check this please: Javascript: control Google Chrome's open tab audio volume control

Diogo Mafra
  • 311
  • 3
  • 6