WordPress.org

Ready to get started?Download WordPress

Forums

Displet Pop
[resolved] Problem with YouTube embed in Pop-Up (3 posts)

  1. mikesakoon
    Member
    Posted 1 year ago #

    I greatly appreciate the Displet Pop plugin, but it looks like I've encountered a problem that might eliminate it as a solution for my site.

    When I use Displet Pop to display and embedded YouTube video, the close button doesn't stop the video from playing. It's visibility seems to be hidden, but the video does not stop playing - the audio continues after the pop-up is gone.

    Is there a way to stop the video when clicking the close button?

    Thanks for your insights and expertise!

    http://wordpress.org/extend/plugins/displet-pop/

  2. displetdev
    Member
    Plugin Author

    Posted 1 year ago #

    Hi mikesakoon -

    Sorry for my delayed response here. We're always pleasantly surprised with new ways people use our plugin. There's not a good way for us to control the volume in an embedded video, so unfortunately, we can't fix this problem. Very sorry about that, and if anyone has any ideas, we'd love to hear them.

    ~EB

  3. criticnic
    Member
    Posted 10 months ago #

    Hi mikesakoon,

    We have run into the same issue with displaying a video using the plugin and having the audio still playing in the background when closing the pop-up, and fortunately were able to come up with a solution! Not sure if you are still in need of help on this, but hopefully it will help someone having a similar issue. The solution involves editing the plugin file (displet-pop.php), so use caution when doing this!
    1) in your displet pop widget, give your YouTube iframe tag a class name. So your code in your widget should look something like this:
    <iframe class="yt" src="http://videourl.com" width="600" height="448"></iframe>
    2) in displet-pop.php, find the function called hideDispletPop(). after the last line of code before the closing } in that function, add a new jQuery line that looks something like the following:

    function hideDispletPop() {
    	jQuery('#displetpop').hide();
    	jQuery('body').removeClass('displetpop');
    	jQuery(".yt").attr('src',''); /* new line here */
    }

    What that last line does is clears the 'src' attribute of your iframe. This basically says when you close the pop-up, set the iframe to nothing so there will be no video to play. When the pop-up opens again, it will open the default iframe in your widget until you close it again.

    Hope this helps!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic