Well i am not a specialist at all, and certainly not in js codes. But i dont think that will help you. At the moment you close the iFrame, the inserted construct code is gone. I think. And you cant change the page that is embedding your code.
Did you try the conditions in the browser plugin ? No luck ?
Page is visible
The iframe is running as overlay in the webpage so if I close the iframe, audio still keep playing. Also, page is invisible also doesn't bcz of same reason.