开发者

Mute sounds in a website programmatically

I have a desktop application, which embeds a web browser control. I do a search an开发者_运维问答d 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜