Custom Code: Video Modal stop playing on close

Hey there,

I was offered some custom code help for creating a video modal. The lightbox didn’t respond well across devices so I made one. How do I add this piece of code to make the video stop playing once the modal is closed?

<script> (document).ready(function() { // config var openvideobutton = '.videolink'; var closevideobutton = '.hidevideo'; // do not touch! var vsrc = (’.w-video’).find(‘iframe’).attr(‘src’); //functions (openvideobutton).click(function() { (’.w-video’).find(‘iframe’).attr(‘src’, vsrc); }); (closevideobutton).click(function() { (’.w-video’).find(‘iframe’).attr(‘src’, ‘’); }); }); </script>

Here is my site share link and the live site:

Thank you!