I am using the Impreza Wordpress theme. To a page on my site, I added a popup modal element which contains an embedded iframe YouTube video. When I add ?autoplay=1 to the iframe src url, the video autoplays as expected when I open the modal popup, but when I close the modal popup, the audio replays even though the modal popup and video are no longer open/visible.
I'm trying to accomplish something like this: Youtube Video Still Playing When Bootstrap Modal Closes. My Javascript skills aren't strong enough to figure out how to apply the Bootstrap modal solution to this situation.
Here's the HTML I put in the popup modal element (Stack Overflow video for example purposes):
<div class="responsive-video">
<iframe class="myEmbed" title="YouTube video player" src="https://www.youtube.com/embed/HJtJXMKpl2g?autoplay=1" allowfullscreen="allowfullscreen" width="1024" height="565" frameborder="0"></iframe></div>
Any suggestions would be greatly appreciated!