1

I have a page which contains an iframe, within said iFrame are several links to video content. What I currently have set up is that when you click the link within the iframe it opens up a Fancybox in the iframes parent window and plays the video. Which works fine, not a problem.

When trying to close the Fancybox it works correctly and shuts the video down. However when using IE, it for some reason keeps the video playing in the background, so even when the Fancybox item has shut down, you can still hear the sound playing.

I cannot change my mediatype as it automatically detects the required playback type for the users browser (so I will be using WMP).

At the moment the only thing I can think of as a way around this is to make the Fancybox load a blank page on the beforeClose callback function, so that the page it tries to shut doesn't contain the video anymore

I have tried to add the following code to my Fancybox but it isnt loading the page the way I thought it should, what have I got wrong.

$('a').click(function(e) {
    parent.$.fancybox({
            href : this.href,
            type : 'iframe',
            width : 990,
            beforeClose : function (){
                parent.$.fancybox({ href: 'blank.html'});
            }
        });
    e.preventDefault();
});

I will try to work on a demo version of this on fiddle, because I cannot show you the real version due to confidentiality

EDIT

HTML code is as follows (without the real link)

<a class="fancybox fancybox.iframe" href="THE LINK">Link</a>
Andrew Morris
  • 1,602
  • 3
  • 14
  • 26
  • I realize this question is old, but future viewers may want to check out the answer/comments here: http://stackoverflow.com/questions/16266298/stop-and-play-iframe-video-when-lightbox-closes – Luke Shaheen Jul 18 '13 at 14:49

0 Answers0