13

I need to mute an iframe, but I don't know how to do it. Here is an example of what I have:

http://www.codecademy.com/en/bitAce74593/codebits/nW7U9b

Here you can hear the music from the website on the iframe, I need to automatically mute that audio. Hope that someone knows how to do it. Thanks

Haunt
  • 135
  • 1
  • 1
  • 5
  • As of 2021, this is not currently possible. If you want it to be supported, staring [this issue](https://bugs.chromium.org/p/chromium/issues/detail?id=985312) may help Chromium contributors gauge interest. If you have a specific use case, you can also leave a comment on that issue (but please don't comment simple/unhelpful things like "I need this!" - just star it instead) – joe Jul 31 '21 at 06:26

1 Answers1

-6

you can mute it by js, example: just put this in your page:

<script type="text/javascript">
    myVid=document.getElementById("video1");
    myVid.muted=true;
</script>

you should replace "video1" by the id of your iframe, if the iframe don't have any id add an id to it as follow:

<iframe width="820" height="390" src="http://nyan.cat" id="iframeId"></iframe>
MD.MD
  • 708
  • 4
  • 14
  • 34
  • Thanks for your answer.I've tried this but It didn't work, please check the code im a beginner and I possibly made a mistake somewhere: http://www.codecademy.com/es/bitAce74593/codebits/nW7U9b Also I've tried to add to iframe that thing style="volume: silent;" but It doesn't work also. – Haunt Aug 18 '14 at 17:03
  • @Alrynec the link that you posted has a self muting javascript code, I feel misunderstanding what do you really want, so could you please put your code on http://jsfiddle.net/ and share the link with us here. – MD.MD Aug 19 '14 at 18:19
  • Here you have it: http://jsfiddle.net/gpo16sLk/ That way videos aren't played so It's not working for my purpose, Im in search of an alternative to only mute audio. Nyan websites is just for example, Im not going to iframe that website – Haunt Aug 21 '14 at 15:10
  • Don't know why this is voted as the correct answer but it doesn't work. – Sebastian Paduano Oct 25 '18 at 07:57