Wasim
Wasim

Reputation: 1935

Mute sounds in a website programmatically

I have a desktop application, which embeds a web browser control. I do a search and iterate over the search list and display it in the embedded browser.

My problem is, some of the sites automatically play sounds of videos (ActiveX) which play sounds.

Is there a way to mute these sounds before displaying the web site?

Upvotes: 3

Views: 259

Answers (1)

drharris
drharris

Reputation: 11214

AFAIK, there is no easy setting that does this. Your options are to disable sounds system-wide, or to simply strip out such things from the document. On DocumentCompleted event you can then get the inner html and strip out any embed tags. Downside to this is it's not 100% foolproof (doesn't prevent any embeds using javascript).

If any embed or javascript-based audio is controllable within javascript, you can try injecting your own javascript to stop it or prevent it. Not sure how well javascript plays with activex, though.

Upvotes: 1

Related Questions