WordPress.org

Ready to get started?Download WordPress

Forums

WP Video Lightbox
[resolved] Youtube audio keeps playing after closing popup (3 posts)

  1. radboud
    Member
    Posted 1 year ago #

    I have setup a youtube movie to play in an iframe using this plugin. To make sure it plays when the thumbnail is clicked, I have set 'AutoPlay' to true in video-lightbox.js.
    In Windows 7, on Internet Explorer 10, when I close the popup, the movie disappears, but the sound keeps on playing. I have verified that this problem doesn't occur on IE 9, Chrome 27, Firefox 21 on Windows, and Safari, Firefox, Opera and Chrome on the Mac.

    It seems the issue has to do with hiding the div containing the movie. In all browsers but IE 10, this will stop the movie from playing.

    As a workaround I have made some changes to my local version of video-lightbox.js. By altering the IFrame src to something else (I used 'www.google.nl'), just before closing the window, the problem went away.

    Code for this:
    Line 5: Added function for the 'ESC' key:

    $(document).keyup(function(e) {
    if (e.keyCode == 27) { // Esc
    clearMovie();
    }
    });

    Line 33:
    markup: '<script language="javascript"> \
    function clearMovie() { \
    document.getElementById("pp_full_res").childNodes[0].src="http://www.google.nl"; \
    } \
    </script> \
    }<div class="pp_pic_holder"> \

    Line 65:
    <a class="pp_close" onClick="clearMovie();" href="#">Close</a> \

    Of course there will be nicer ways of doing this using JQUERY, but at least it works for me.

    Cheers,
    Radboud

    http://wordpress.org/extend/plugins/wp-video-lightbox/

  2. ahallock
    Member
    Posted 1 year ago #

    Thank you so much. This was driving me insane.

  3. mra13
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you. We will add this to the plugin in the next version.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic