Trouble with inline that includes YouTube player
-
I have a lightbox with inline content, part of which is a YouTube player using the WP YouTube Lyte plugin. Due to the way the lightbox is hidden once it’s closed, if you’ve started the video, once you close it restarts playing in the background even though it’s hidden. I had checked with the WP YouTube Lyte developer, and they described the issue like this:
* hidden div with lyte player in your HTML
* clicking the box moves that HTML with lyte player into the popup
* clicking the play button replaces the lyte player with a real youtube which autoplays
* clicking “X” copies the autoplaying youtube back to a hidden part of your HTML, but by appending it to your HTML, it autoplaysAnd for a solution, they mentioned this:
* copy the HTML with the lyte div to a javascript variable on the onLoad (or onOpen) event
* overwrite the HTML with the autoplaying youtube iframe by the HTML with the lyte div from the js variableIs there some way to do this with lightboxes called via the shortcodes? They linked to a stackoverflow with what they were describing, but it looked like that was from a jquery call for the lightbox rather than using the shortcodes from the WP Colorbox plugin.
- The topic ‘Trouble with inline that includes YouTube player’ is closed to new replies.