4

I'm looking for a way to mute sound or block it from unauthorized sources, The problem is that Google Ads is randomly playing videos in ads (very annoying)

For example, I want users to be able to play videos on my web site (I can add a special ID to these allowed elements or data-allowed-element).

I'm wonder if I can hookup to a browser sound event or detect when sound is playing - JavaScript?

Any ideas?

Yovav
  • 2,557
  • 2
  • 32
  • 53

1 Answers1

2

No there is currently no way to detect this browser independent! - There is no event or something else.

Furthermore i dont know exactly how the Google Ads works. I think they are running in an iframe or something which make it harder to detect/mute it.

But may it runns within an audio or video tag, so you can may mute it using the following post. But be careful - You have to mute the video and audio tags within the Google Ads iframe and not within your main window, because then you will have no effect. https://stackoverflow.com/a/14045788/4275911

Community
  • 1
  • 1
kpalatzky
  • 1,213
  • 1
  • 11
  • 26