I've searched and searched but can only find very old posts about this sort of thing. What I am looking to do is create multiple Foundation 6 Reveal modals that open up YouTube videos that will autoplay, and stop video/audio when the modal is closed.
Here is a basic set up. Any help would be great!!
<p><a data-open="videoModal-01">Click me for a modal 01</a></p>
<p><a data-open="videoModal-02">Click me for a modal 02</a></p>
<!-- modal 01 -->
<div class="reveal" id="videoModal-01" data-reveal>
<div class="responsive-embed">
<iframe width="560" height="315" src="https://www.youtube.com/embed/4krs7z2bjlE" frameborder="0" allowfullscreen></iframe>
</div>
<button class="close-button" data-close aria-label="Close modal" type="button">
<span aria-hidden="true">×</span>
</button>
</div>
<!-- modal 2 -->
<div class="reveal" id="videoModal-02" data-reveal>
<div class="responsive-embed">
<iframe width="560" height="315" src="https://www.youtube.com/embed/c8aFcHFu8QM" frameborder="0" allowfullscreen></iframe>
</div>
<button class="close-button" data-close aria-label="Close modal" type="button">
<span aria-hidden="true">×</span>
</button>
</div>
I would create Reveal modals via JS and use Youtube IFrame Player API to create, load, start and stop video. Here is a partial prototype to get you started (it's missing player functionality).