Is there any way to disable all sound on a browser window that may have embedded videos?
I'm not looking for particular solutions such as targeting Youtube with js etc... I need something general that will shut off all sound for that page so if any video plays it has NO sound. Need something that shuts off sound at the page level, not individually addressing each player via js etc...
I'm not aware of anything that could do that but thought I'd ask.
Many thanks if you could point me in the right direction.
PS: I know about How to mute all sound in a page with JS? but it's not what I need.
Is there any way to disable all sound on a browser window that may have embedded videos?
I'm not looking for particular solutions such as targeting Youtube with js etc... I need something general that will shut off all sound for that page so if any video plays it has NO sound. Need something that shuts off sound at the page level, not individually addressing each player via js etc...
I'm not aware of anything that could do that but thought I'd ask.
Many thanks if you could point me in the right direction.
PS: I know about How to mute all sound in a page with JS? but it's not what I need.
Share Improve this question edited May 23, 2017 at 12:01 CommunityBot 11 silver badge asked Apr 15, 2014 at 12:58 Noodle HeadNoodle Head 4313 gold badges11 silver badges23 bronze badges 1- Did you read that thread? The solution states "But you get the idea, iterate through media, check/store playing status, and mute/unmute" This is NOT what I want to do as I clearly stated in my op. – Noodle Head Commented Apr 15, 2014 at 13:25
1 Answer
Reset to default 3You necessary have to iterate in all audio/video tag and set volume to 0.
HTML
<div id="mute-button"><img src=""/><div>
JQuery
$('#mute-button').on('click', function(){
$('audio,video').each(function(){
$(this).volume = 0.0;
});
});
Alternatively you can pause source:
$(this).pause();
For other embedded tag (youtube, vimeo..), take a look at this discussion.