Stop / pause edge envelope sound inside iframe using external javascript?

I have an oval version (version 4.0) inside this iframe in a div collection and I need to pause / stop the sound of the iframe when I hide ( display:none

) it, and resume / play when I show it ( display:inline

).

Now I have something like this:

    if(!$('#slide_'+(slide_current-1)).find('iframe').hasClass('edgeanimate'))//
  {
    //Do nothing.
  }
  else
  {

    //Pause/Stop the sound, please
  }

      

The deal is that I can't touch the original javascript that comes out with the edge-animate export format; I need to stop sound using an external JS script ... Any ideas? Please, help.

Thank you very much.

+3


source to share


2 answers


If you want to stop Audio on a different page and you have access to both, you might look something like this:



$('iframe').each(function(i, e){
  e.contents().find('audio').each(function(n, a){
    a.pause();
  });
});

      

0


source


Source:

document.getElementByName("iframe")
.contentWindow.postMessage('{"method":"setVolume", "value":0}','*');

      



I think this should have done the trick

0


source







All Articles